Consider two integers a and b. Their bitwise xor (exclusive or) is computed as it follows:
For example, 9 ^ 3 = 10 because 9 = 1001(2), 3 = 0011(2) and 10 = 1010(2).
You are given a sequence of N operations on a set of integers. The set is initially empty. Each operation can be one of the following:
You must print the output from every min-xor() operation.
The first line of the input contains the number of operations N. Each of the following lines describes an operation using the following syntax:
The output must contain a number of lines equals to the number of min-xor() operations. Each line must contain a single number, the answer to the corresponding min-xor() operation.
For the first min-xor(), the set is {24, 17}. The minimum bitwise xor is 24 ^ 17 = 9.
For the second min-xor(), the set is {24, 17, 23, 30}. The minimum bitwise xor is 24 ^ 30 = 6 (also 17 ^ 23 = 6).
For the third min-xor(), the set is {24, 23, 30}. The minimum bitwise xor is 24 ^ 30 = 6.
For the last min-xor(), the set is {24, 23}. The minimum bitwise xor is 24 ^ 23 = 15.