I. Tree
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

Setsuna has a tree with $$$n$$$ nodes. Each edge has a value of $$$w_i$$$. Then she will perform $$$q$$$ operations. There are two types of operations:

Type 1: Give three integers $$$x\ y\ z$$$, change the value of every edge on the simple path between $$$x$$$ and $$$y$$$. If the value of an edge is $$$w$$$ before the operation, the value becomes $$$w\oplus z$$$ after the operation. $$$\oplus$$$ means bitwise xor.

Type 2: Give an integer $$$x$$$, and you need to print the bitwise xor of values of all edges connected to $$$x$$$.

A tree with $$$n$$$ nodes is defined as an undirected connected graph with $$$n$$$ nodes and $$$n-1$$$ edges. A simple path is a path in a graph that does not have repeating nodes.

Input

The first line contains two integers $$$n,q\ (1\le n,q\le 5\times 10^5)$$$, denoting the number of nodes of the tree and the number of operations.

Next $$$n-1$$$ lines, each line contains three integers $$$x,y,w\ (1\le x,y\le n,0\le w<2^{20})$$$, denoting that there is an edge between $$$x$$$ and $$$y$$$ with value $$$w$$$.

Next $$$q$$$ lines, each line starts with a integer $$$op\ (1\le op\le 2)$$$. If $$$op=1$$$, it means that this operation is of type 1, then there are three integers $$$x,y,z\ (1\le x,y\le n,0\le z<2^{20})$$$. If $$$op=2$$$, it means this operation is of type 2, then there is an integer $$$x\ (1\le x\le n)$$$.

Output

For each operation of type 2, output one line, denoting the answer.

Example
Input
3 3
1 2 1
1 3 2
2 1
1 1 3 2
2 1
Output
3
1