You are given an undirected connected graph with weighted edges. The length of some path between two vertices is the bitwise xor of weights of all edges belonging to this path (if some edge is traversed more than once, then it is included in bitwise xor the same number of times).
There are three types of queries you have to process:
Print the answers for all queries of type 3.
The first line contains two numbers n and m (1 ≤ n, m ≤ 200000) — the number of vertices and the number of edges in the graph, respectively.
Then m lines follow denoting the edges of the graph. Each line contains three integers x, y and d (1 ≤ x < y ≤ n, 0 ≤ d ≤ 230 - 1). Each pair (x, y) is listed at most once. The initial graph is connected.
Then one line follows, containing an integer q (1 ≤ q ≤ 200000) — the number of queries you have to process.
Then q lines follow, denoting queries in the following form:
It is guaranteed that at least one query has type 3.
Print the answers for all queries of type 3 in the order they appear in input.
5 5
1 2 3
2 3 4
3 4 5
4 5 6
1 5 1
5
3 1 5
1 1 3 1
3 1 5
2 1 5
3 1 5
1
1
2
Name |
---|