Even though they are tiny now, they will be shiny shooting stars someday.
It is every newbie's dream to be a grandmaster in algorithm contests, including Zayin. So it is your task to encourage him.
Zayin is solving a problem. He is given an integer $$$n$$$ where $$$n$$$ is an odd prime. Simultaneously there is an undirected graph with $$$n-1$$$ vertexes, labeled from $$$1$$$ to $$$n-1$$$, and a parameter $$$a\in[1,n)$$$. For every vertex $$$i$$$, Zayin has to assign an edge for it from one of the two options:
$$$a$$$ is not shown to Zayin until he has decided the way to assign edges. After that, Zayin runs his naive algorithm on the graph. For every connected component with size $$$s$$$, the time cost is $$$s^2$$$.
If the total time cost is less or equal than $$$12n$$$, the algorithm will be accepted.
You are to help Zayin in the following ways:
The only line contains an integer $$$n$$$. ($$$3 \le n \le 10^4$$$, $$$n$$$ is an odd prime.)
The only line contains $$$n-1$$$ integers $$$oracle_1,\cdots,oracle_{n-1}$$$, representing your oracle sequence.
5
0 0 0 0