José is practicing graph and tree problems on the HuronCoder platform, and he came across the following challenge.
You are given a tree with $$$n$$$ nodes, rooted at node $$$1$$$. The parent of each node $$$u$$$ is $$$p_u$$$, with $$$1 \le p_u \lt u$$$. Each node $$$u$$$ has an associated value $$$a_u$$$.
You need to process queries of three types:
José needs your help.
The first line contains two integers $$$n$$$ and $$$q$$$ ($$$2 \leq n \leq 2 \cdot 10^5$$$ and $$$1 \leq q \leq 2 \cdot 10^5$$$) — the number of nodes in the tree and the number of queries.
The second line contains $$$n-1$$$ integers $$$p_2,p_2,\dots,p_n$$$ ($$$1 \leq p_i \lt i$$$) — the parent of each node.
The third line contains $$$n$$$ integers $$$a_1,a_2\dots,a_n$$$ ($$$|a_i| \leq 10^9$$$) — the initial values of each node.
The next $$$q$$$ lines describe the queries:
For each query of type $$$2$$$, print an integer representing the answer to this query.
5 71 1 3 33 -5 2 -1 -32 4 53 2 5 12 4 51 2 12 4 53 4 5 22 4 2
2 -1 1 4
| Name |
|---|


