Input comes from standard input. The first line has the number of vertices N of the tree. (2≤N≤100000) The vertices are numbered from 1 to N. Each of the next N−1 lines has an edge a and b, meaning vertex a and vertex b are connected. The given graph is always a tree. (1≤a,b≤N)
The next line has the number of queries q. (1≤q≤100000) Each of the next q lines has a query t and k. (1≤t≤2) If t is 1, the query asks whether vertex k is a cut vertex. If t is 2, the query asks whether the k-th edge of the input is a bridge. When t is 1, 1≤k≤N. When t is 2, 1≤k≤N−1.