You are given a tree with nodes. You should process queries of two types:
: is an edge from the initial tree. If the edge is still in the tree, delete it, else add it back.
: this output is either or . Consider that total is the sum of all the previous type 2 queries. Then compute , .
Output if you can reach from , or if you cannot.
Input data
The first line of the input will contain , .
On the next lines you will find the description of the tree. On each line there will be a pair (), representing that there will be an edge between and .
On the next lines you will find a triplet () representing a query, is or .
Output data
The output will contain as many lines as there are type queries in the input. The line will contain the answer for the type query.
Constraints and clarifications
- For tests worth points, .
- For tests worth more points, .
Example
stdin
5 3
1 4
4 2
5 2
3 5
2 1 3
1 2 5
2 1 3
stdout
1
1