409780: GYM103741 J Sequence
Description
Walk_alone loves sequences. For a sequence $$$a_1,a_2,\dots,a_n$$$ of length $$$n$$$, he defines $$$A_i\ (1\le i< 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<2^{20})$$$ to the back of the sequence.
- 2: output $$$\max_{1\le i<n}A_i$$$ where $$$n$$$ is the length of sequence $$$a$$$. The answer is $$$0$$$ if $$$n<2$$$.
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<2^{20}$$$ for every operation of the first type.
OutputFor each operation of the second type, output the answer in a line.
ExampleInput11 1 6 2 1 7 2 1 13 1 4 1 14 2 1 14 1 10 2Output
0 6 8 12