Notice:Don't output extra spaces at the end of one line.
Koishi loves bitwise xor!
Satori knows that, so she decides to play a game with Koishi and her $n$ pets. There are $n$ pets standing in a row, and the $i$-th of them has $m_i$ kinds of magic, the $j$-th magic can be described as a pair of non-negative integers$(x_{ij},y_{ij})$. If she use this magic to a non-negative integer $w$, then she can turn $w$ into $w\oplus x_{ij}$ or $w\oplus y_{ij}$ as she wants. addtionally, the $i$-th pet has her favorate integer $p_i$.
Satori's game consists of $q$ rounds. In each round, one of following two things may happan:
1. Koishi closes her third eye, so Satori select one of her pets, and change its favorate integer.
2. Koishi's third eye reopens, so Satori tells three non-negative integers $l,r,x(1\leq l\leq r\leq n)$. Then, pets with index from $l$ to $r$ will use the magic to the integer $x$ one by one($l$-th is the first and $r$-th is the last), every pet \textbf{must} use \textbf{each} of her magic \textbf{exactly once}. After $r$-th pet finishes her operation, integer $x$ will become $y$ at last. Every pet want the final $y$ to be her own favorate integer $p$. so the $i$-th pet will try her best to make $y\oplus p_i$ as small as possible(notice $y$ is the final integer) . Every pet konws any other pets' magic details, favorate integer, and $l,r,x$ in the current round. Suppose they are all the cleverest, what's the final integer $y$?
Koishi is NO.1 all over the world, so she computes the final $y$ easily.
What about you?