Score : $300$ points
We will call a sequence of length $N$ where each of $1,2,\dots,N$ occurs once as a permutation of length $N$.
Given a permutation of length $N$, $P = (p_1, p_2,\dots,p_N)$, print a permutation of length $N$, $Q = (q_1,\dots,q_N)$, that satisfies the following condition.
It can be proved that there exists a unique $Q$ that satisfies the condition.
Input is given from Standard Input in the following format:
$N$ $p_1$ $p_2$ $\dots$ $p_N$
Print the sequence $Q$ in one line, with spaces in between.
$q_1$ $q_2$ $\dots$ $q_N$
3 2 3 1
3 1 2
The permutation $Q=(3,1,2)$ satisfies the condition, as follows.
3 1 2 3
1 2 3
If $p_i = i$ for every $i$ $(1 \leq i \leq N)$, we will have $P = Q$.
5 5 3 2 4 1
5 3 2 4 1