You are given a rooted tree consisting of $$$n$$$ vertices numbered from $$$1$$$ to $$$n$$$ and vertex $$$1$$$ is the root of the tree. The depth of vertex $$$1$$$ is $$$1$$$.
A tree is a connected undirected graph with $$$n - 1$$$ edges.
Now there are $$$q$$$ tasks that you need to do, and the $$$i$$$-th task is one of the following three types:
It is guaranteed that the vertex $$$x$$$ must exist in the current tree.
The first line of the input contains two integers $$$n, q$$$ $$$(2 \le n \le 2 \times 10^5, 1 \le q \le 2 \times 10^5)$$$.
The second line contains $$$n - 1$$$ integers $$$p_2, p_3, ..., p_n$$$ — the parents of vertices from the second to the $$$n$$$-th $$$(1 ≤ p_i \lt i)$$$.
The next $$$q$$$ lines each line contains two integers, and the $$$i$$$-th line belongs to one of the three types mentioned above.
It is guaranteed that there has at least one query task.
For each query task, you should output one line containing an integer.
6 5 1 1 3 3 3 3 4 1 3 3 4 2 3 3 4
3 4 3
| Name |
|---|


