AT_abc445_c [ABC445C] Sugoroku Destination
Description
There are $ N $ cells, cell $ 1, $ cell $ 2,\ldots, $ cell $ N $ , arranged in a line. Cell $ i $ has an integer $ A_i\ (i \le A_i \le N) $ written on it.
For each of $ s=1,2,\ldots,N $ , solve the following problem.
- Initially, place a piece on cell $ s $ . After performing the operation "let $ x $ be the integer written on the cell where the piece is placed, and then move the piece to cell $ x $ " $ 10^{100} $ times, output the number of the cell where the piece is placed.
Input Format
The input is given from Standard Input in the following format:
>$N$
$A_1$ $A_2$ $\ldots$ $A_N$
Output Format
Output the answers for $ s=1,2,\ldots,N $ in this order on a single line, separated by spaces.
Explanation/Hint
### Sample Explanation 1
For $ s=1 $ , the piece moves as shown in the following figure.

When the piece is placed on cell $ 5 $ , the operation does not move the piece, so the answer for $ s=1 $ is $ 5 $ .
### Sample Explanation 2
It is possible that the piece never moves.
### Constraints
- $ 1 \le N \le 5\times10^5 $
- $ i \le A_i \le N\ (1 \le i \le N) $
- All input values are integers.