The training committee keeps its $$$n$$$ contestants in a single mentoring tree. Contestant $$$1$$$ is the head coach, and every other contestant $$$i$$$ is mentored by exactly one contestant $$$p_i$$$. Contestant $$$i$$$ has solved $$$a_i$$$ problems so far.
The team of a contestant $$$u$$$ is $$$u$$$ together with everybody whose chain of mentors passes through $$$u$$$: the contestants mentored by $$$u$$$, the ones mentored by those, and so on. Every contestant belongs to their own team.
The season is long and the committee keeps rearranging the tree. There are $$$q$$$ events, each of one of four kinds.
In the last two events $$$u$$$ counts as a member of its own team, contributing $$$a_u$$$ problems and a mentoring distance of $$$0$$$.
The first line contains two integers $$$n$$$ and $$$q$$$ ($$$1 \le n \le 10^5$$$, $$$1 \le q \le 10^5$$$) — the number of contestants and the number of events.
The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ ($$$1 \le a_i \le 10^6$$$) — the problems each contestant has already solved.
The third line contains $$$n-1$$$ integers $$$p_2,p_3,\ldots,p_n$$$ ($$$1 \le p_i \le n$$$) — the mentor of each contestant other than the head coach. The mentoring links form a rooted tree: following mentors from any contestant reaches contestant $$$1$$$. A mentor may have a larger index than the contestant they mentor. This line is empty when $$$n = 1$$$.
Each of the next $$$q$$$ lines describes one event and starts with its kind.
For every event of kind $$$3$$$ or $$$4$$$, print one line with the requested value, in the same order as the events appear in the input.
The answers can exceed $$$2^{31}$$$. They are compared as a sequence of integers.
7 610 20 30 40 50 60 701 1 1 2 2 43 24 12 2 53 21 2 44 1
130 9 145 12
5 61 2 3 4 51 1 2 21 2 54 12 2 103 11 2 34 1
6 45 9
3 45 5 51 24 11 3 14 13 3
3 2 5