시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
5 초 512 MB 0 0 0 0.000%

문제

This is an interactive problem.

I have a hidden permutation p1, p2, . . . , pn. You are to guess it.

You can make some queries. In one query you tell me a permutation q1, q2, . . . , qn of length n, and I reply you with similarity of permutations p and q.

The similarity of two permutations is defined as follows. Let w1, w2, . . . , wn be a permutation, then define N(w) as the set of unordered pairs of adjacent elements in w. For example, N([4, 1, 3, 2]) = {{1, 4}, {1, 3}, {2, 3}}. This way, the similarity of p and q is the size of N(p) ∩ N(q).

You can make at most 25 000 queries. Note that no algorithm in the world can distinguish between p and reversed p, so both of these permutations will be accepted as correct answer.

This time I will not mess with you and will not change the hidden permutation. Though I could. You should be thankful, really.

입력

Initially you get a single line with a single integer n (2 ≤ n ≤ 400) — the size of the hidden permutation.

출력

When you know the hidden permutation, print an exclamation mark “!” and then n integers p1, p2, . . . , pn, or pn, pn−1, . . . , p1.

This does not count towards query limit.

예제 입력 1

5

1

3

4

예제 출력 1

? 1 2 3 4 5

? 2 4 3 5 1

? 3 4 2 5 1

! 3 4 2 5 1

채점

  • 예제는 채점하지 않는다.