Algorithm of Professor Ivanov#5616

Algorithm of Professor Ivanov

1 second
64 megabytes
Very easy

Professor Ivanov has told Professor Petrov about a new sorting algorithm based on the following function .

\textbf{for } j := 0 \textbf{ to } n - 1 \textbf{ do}
\ \ \textbf{if } p_j = a \textbf{ then}
\ \ \ \ k := j
\textbf{swap}(k, (k + p_k) \bmod n);

The function \textbf{swap}(i, j) swaps the elements p_i and p_j.

Professor Ivanov claims that any permutation p_0, \ldots, p_{n-1} of the integers 1, \ldots, n can be sorted in ascending order using several calls of the function . All you need is to choose, for each call of the function, the correct integer argument in the range from to .

Professor Petrov trusts his colleague, but he does not fully understand the algorithm. Therefore, he proposed a permutation p_0, \ldots, p_{n-1} and asked Professor Ivanov to sort it in ascending order using the function .

Input

The first line contains an integer (1 \leq n \leq 500). The second line contains the permutation p_0, \ldots, p_{n-1} of the integers from to , proposed by Professor Petrov.

Output

If Professor Ivanov cannot sort the given permutation using the function , print "Impossible". Otherwise, print an integer (0 \leq m \leq 10^6) on the first line — the number of calls to the function. On the next lines, print the argument (1 \leq a \leq n) that should be used in each call. It is guaranteed that if it is possible to sort the given permutation, it can be done in no more than 10^6 function calls.

Examples

Example 1

Loading
Loading