J. Sequence
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Walk_alone loves sequences. For a sequence $$$a_1,a_2,\dots,a_n$$$ of length $$$n$$$, he defines $$$A_i\ (1\le i \lt n)$$$ as

$$$$$$A_i=\bigoplus_{j=1}^i \bigoplus_{k=i+1}^n a_j \,\&\, a_k$$$$$$

where $$$\&$$$ represents the bitwise AND, and $$$\oplus$$$ means bitwise XOR.

Now Walk_alone has an initially empty sequence. He will do $$$q$$$ operations to this sequence, and there will be two types of operations:

  • 1 x: add an element $$$x\ (0\le x \lt 2^{20})$$$ to the back of the sequence.
  • 2: output $$$\max_{1\le i \lt n}A_i$$$ where $$$n$$$ is the length of sequence $$$a$$$. The answer is $$$0$$$ if $$$n \lt 2$$$.
Input

The first line of the input contains one integer $$$q\ (1 \leq q \leq 10^5)$$$, indicating the number of operations.

Each of the next $$$q$$$ lines will contain one kind of operations described above. It is guaranteed that $$$0\le x \lt 2^{20}$$$ for every operation of the first type.

Output

For each operation of the second type, output the answer in a line.

Example
Input
11
1 6
2
1 7
2
1 13
1 4
1 14
2
1 14
1 10
2
Output
0
6
8
12