In the Odoo interface, you realize that it's all about views and smart buttons. Let's consider that Odoo has N distinct views and for each view, there are some smart buttons to take you to other views.
It's guaranteed that :
Since views are a very important part of Odoo, they should be tested carefully. That's where the Odoo tour test comes into play. The developers at Odoo developed an automatic testing program which will run infinitely. The test consists of a cyclic list of views of size $$$k$$$ (not necessarily distinct). At the start, the program starts from a view at some position $$$p$$$ in the list, then he goes to the next view at position $$$p+1$$$ using the minimum number of clicks, then to the view at position $$$p+2$$$ and so on (the view at position $$$1$$$ comes after the view at position $$$k$$$). A view is called tested if it is visited at least one time at some point during the test. You realized that some views might not get tested, so you introduced some updates to the original list of views and some other queries to collect analytics. The queries go as follows:
The first line of the input contains $$$2$$$ integers $$$n$$$ and $$$k$$$ $$$(1\leq n\leq 10^{5}, 1 \leq k \leq 10^{5})$$$, the number of views and the size of the list of views of the test.
The second line contains $$$k$$$ integers $$$v_{i}$$$ $$$(1\leq v_{i} \leq n)$$$, the ids of the views in the list of the test.
The next $$$n-1$$$ lines each contain $$$2$$$ integers $$$u$$$ and $$$v$$$ $$$(1\leq u, v \leq n, u \ne v)$$$, which means that views with id $$$u$$$ and $$$v$$$ have a smart button that connects them.
The next line contains an integer $$$q$$$ $$$(1\leq q\leq 10^{5})$$$, the number of queries to process.
The next $$$q$$$ lines each contain $$$3$$$ integers $$$t$$$, $$$p$$$, and $$$u$$$ $$$(1\leq t\leq 2, 1\leq p \leq k, 1\leq u\leq n)$$$, the description of the query.
Print the answer for each query of the type $$$2$$$ in separate lines. It's guaranteed that there is at least one query of type $$$2$$$.
9 44 6 8 91 22 33 44 52 62 76 84 982 2 92 1 72 4 82 4 92 1 92 2 21 3 12 2 2
6 -1 5 0 9 3 1
| Name |
|---|


