You are given n (0≤n≤500000) and q (1≤q≤600000) where n is a number of vertexes and q is a number of queries. Initially, you have a graph with no edges and 0 is written on every vertex, then you need to process q queries.
You have three types of queries:
Input format
Output format
For each query of 3 type, you should print answers on a different line.
In first test case: 0 written on every vertex, so answer for vertex 1 is 0.
In second test case:
1st query, you add 1 to vertex 1 only.
2nd query. you print the written number on vertex 1, which is 1.
3rd query, you add edge between 1 and 2
4th query, you print the written number on vertex 1, which is 1.
5th query, you print the written number on vertex 2, which is 0.