Secret Permutation

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

This is an interactive problem.

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

입력

The only line of the input contains an integer nn (1n51031 \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 nn 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.