시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB399618.750%

문제

This is an interactive problem.

There is a secret permutation $p$ of integers from $0$ to $n - 1$. The permutation is indexed starting from $0$. You have to guess it by asking questions of the form "? $a_i$ $b_i$ $c_i$" ($a_i$, $b_i$ and $c_i$ are integers from $0$ to $n - 1$). For each such question, you will get one number in response which equals $p^{-1} (p (a_i) \cdot p (b_i) + p (c_i))$ (all operations are performed modulo $n$, and $p^{-1} (x)$ is such $y$ that $p (y) = x$). In the end, you have to print the guessed permutation in the form "! $p (0)$ $p (1)$ $\ldots$ $p (n - 1)$".

입력

The only line of the input contains an integer $n$ ($1 \leq n \leq 5 \cdot 10^3$).

In each test, the permutation is fixed in before the contest and does not change during the guessing process.

For each test, the length $n$ was picked by the jury, but the permutation was then generated using a pseudorandom number generator. However, the problem has a deterministic solution which works for every possible permutation.

프로토콜

You can ask zero or more questions and make exactly one guess in the end. Print each query on a separate line and do not forget to flush the output buffer. The maximum allowed number of queries, including the final guess, is $12\,512$.

예제 입력 1

4

3

2

1

예제 출력 1

? 1 2 3

? 0 3 3

? 0 0 1

! 2 0 3 1

채점 및 기타 정보

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