B. Distinct Xor Subsequence Queries
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given an empty sequence $$$a$$$. Your task is to process $$$q$$$ queries of the following types:

1. Append $$$x$$$ to the end of sequence $$$a$$$;

2. Among all distinct numbers you can produce by choosing any subsequence(possibly empty) from $$$a$$$ and calculating their bitwise XOR, print the $$$k$$$-th smallest one. If such a number does not exist, print $$$-1$$$ instead.

Input

The first line of input contains a single integer $$$q \ (1 \le q \le 2 \times 10^5)$$$.

Then, there are $$$q$$$ lines describing the queries. Each line has two integers: $$$1\ x \ (0 \le x \lt 2^{60})$$$ or $$$2\ k \ (1 \le k \le 2^{60})$$$

Output

For each query of type 2, print a line of a single integer denoting the answer.

Examples
Input
7
1 5
1 6
2 1
2 2
2 3
2 4
2 5
Output
0
3
5
6
-1
Input
3
1 1000
1 1000
2 3
Output
-1