K. Coach
time limit per test
6 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

You are a coach for $$$n$$$ athletes, numbered $$$1,2,\dots,n$$$, and after two years of training you know their strengths and weaknesses very well.

You notice, however, that some athletes are friends. Furthermore, the friendship is always mutual, that is, if athlete $$$a$$$ is a friend of athlete $$$b$$$, then athlete $$$b$$$ is a friend of athlete $$$a$$$.

There are exactly $$$n-1$$$ friendships, and there is no cycle of friendships, that is, a sequence $$$a_1,a_2,\dots,a_k$$$ of $$$k\geq 3$$$ distinct athletes such that athlete $$$a_i$$$ is a friend of athlete $$$a_{i+1}$$$ for $$$1 \leq i \leq k-1$$$ and athlete $$$a_k$$$ is a friend of athlete $$$a_1$$$.

You, however, do not know their friendships. But you can try and create courses to deduce them. That is, for every permutation $$$p_1,p_2,\dots,p_n$$$ of $$$1,2,\dots,n$$$, since you know each athlete, you can create a course such that it is guaranteed that athlete $$$i$$$ finishes in $$$p_i$$$-th position.

After the athletes finish a course, they compare themselves to their friends. An athlete is happy if it finishes first compared to their friends. You can then know the number of happy athletes, but you do not know which athletes are happy.

Since you do not want to put too much pressure, you can create at most $$$25000$$$ courses.

What are the friendships of the athletes?

The friendships are fixed before any queries are made and do not change.

Interaction

The interactor first outputs an integer $$$n$$$ $$$(3 \leq n \leq 500)$$$, denoting the number of athletes.

You can then start asking queries.

You start your query with a ?. Then, $$$n$$$ integers follow, which form a permutation of $$$1,2,\dots,n$$$.

? p1 p2 ... pn

When you know the friendships, you must send a line starting with a ! followed by a space, then $$$n-1$$$ pairs of integers $$$(a_i,b_i)$$$ denoting the friendships. No two friendships can be repeated, and no friendship appears more than once (the pairs are unordered).

! a1 b1 a2 b2 ... an-1 bn-1
Examples
Input
4

1
Output

? 2 3 1 4

! 1 2 1 3 1 4 
Input
5

2
Output

? 2 3 1 4 5

! 1 3 2 3 2 5 4 5