Miceren finds a huge country named HY. HY has $N$ cities numbered from 1 to $N$ connected by $N~-~1$ bidirectional roads. There exists a path between any two cities.
It can be imagined as a tree with $n$ vertices rooted at vertex 1.
Miceren wants to occupy some cities here. Each city has a value $v_i$. (Notice that the value of a city may be negative. Nevertheless, Miceren wants to occupied this city.)
As some usual stories, someone named Cloud wants to "steal" some cities from Miceren.
At the beginning, Miceren and Cloud don't occupy any city.
In the following $Q$ days, one of three events may happen
1. Miceren will walk from the a-th city to the b-th city and all cities visited in this trip will belong to Miceren. ($1~\le~a, b~\le~N$)
2. Cloud will steal the x-th city. If Miceren occupied the x-th city before, Miceren will lost the control of this city. ($1~\le~x~\le~N$)
3. Miceren will occupy the subtree rooted at x.($1~\le~x~\le~N$)
As Miceren's friend, you must tell Miceren the total value of all cities which belong to Miceren after each day.