{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003eThis is an interactive problem.\u003c/span\u003e\u003c/p\u003e\u003cp\u003eWe hid from you a permutation $$$p$$$ of length $$$n$$$, consisting of the elements from $$$1$$$ to $$$n$$$. You want to guess it. To do that, you can give us 2 different indices $$$i$$$ and $$$j$$$, and we will reply with $$$p_{i} \\bmod p_{j}$$$ (remainder of division $$$p_{i}$$$ by $$$p_{j}$$$).\u003c/p\u003e\u003cp\u003eWe have enough patience to answer at most $$$2 \\cdot n$$$ queries, so you should fit in this constraint. Can you do it?\u003c/p\u003e\u003cp\u003eAs a reminder, a permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array) and $$$[1,3,4]$$$ is also not a permutation ($$$n\u003d3$$$ but there is $$$4$$$ in the array).\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe only line of the input contains a single integer $$$n$$$ ($$$1 \\le n \\le 10^4$$$) — length of the permutation.\u003c/p\u003e"}},{"title":"Interaction","value":{"format":"HTML","content":"\u003cp\u003eThe interaction starts with reading $$$n$$$. \u003c/p\u003e\u003cp\u003eThen you are allowed to make at most $$$2 \\cdot n$$$ queries in the following way: \u003c/p\u003e\u003cul\u003e \u003cli\u003e \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e? x y\u003c/span\u003e\" ($$$1 \\le x, y \\le n, x \\ne y$$$). \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eAfter each one, you should read an integer $$$k$$$, that equals $$$p_x \\bmod p_y$$$. \u003c/p\u003e\u003cp\u003eWhen you have guessed the permutation, print a single line \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e! \u003c/span\u003e\" (without quotes), followed by array $$$p$$$ and quit.\u003c/p\u003e\u003cp\u003eAfter printing a query do not forget to output end of line and flush the output. Otherwise, you will get \u003cspan class\u003d\"tex-font-style-tt\"\u003eIdleness limit exceeded\u003c/span\u003e. To do this, use:\u003c/p\u003e\u003cul\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003efflush(stdout)\u003c/span\u003e or \u003cspan class\u003d\"tex-font-style-tt\"\u003ecout.flush()\u003c/span\u003e in C++;\u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eSystem.out.flush()\u003c/span\u003e in Java;\u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003eflush(output)\u003c/span\u003e in Pascal;\u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003estdout.flush()\u003c/span\u003e in Python;\u003c/li\u003e\u003cli\u003e see documentation for other languages.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eExit immediately after receiving \"\u003cspan class\u003d\"tex-font-style-tt\"\u003e-1\u003c/span\u003e\" and you will see \u003cspan class\u003d\"tex-font-style-tt\"\u003eWrong answer\u003c/span\u003e verdict. Otherwise you can get an arbitrary verdict because your solution will continue to read from a closed stream.\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003eHack format\u003c/span\u003e\u003c/p\u003e\u003cp\u003eIn the first line output $$$n$$$ ($$$1 \\le n \\le 10^4$$$). In the second line print the permutation of $$$n$$$ integers $$$p_1, p_2, \\ldots, p_n$$$.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n\n1\n\n2\n\n1\n\n0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e? 1 2\n\n? 3 2\n\n? 1 3\n\n? 2 1\n\n! 1 3 2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}