Problem Statement
There is a blackboard on which you can write integers. Initially, no integer is written on the blackboard. Given $Q$ queries, process them in order.
The query is of one of the following three kinds:
1 x: write an$x$on the blackboard.2 x: erase an$x$from the blackboard. At the point this query is given, it is guaranteed that at least one$x$is written on the blackboard.3: print the minimum possible bitwise XOR of two of the integers written on the blackboard. At the point this query is processed, it is guaranteed that at least two integers are written on the blackboard.
What is bitwise XOR? The bitwise XOR of non-negative integers $A$ and $B$, $A \oplus B$, is defined as follows. When $A \oplus B$ is written in binary, the $2^k$s place ($k \geq 0$) is $1$ if exactly one of the $2^k$s places of $A$ and $B$ is $1$, and $0$ otherwise. For instance, $3 \oplus 5 = 6$ (in binary: $011 \oplus 101 = 110$).
Constraints
$1\leq Q \leq 3\times 10^5$$0\leq x < 2 ^{30}$- When a query
$2$is given, at least one$x$is written on the blackboard. - When a query
$3$is given, at least two integers are written on the blackboard. - All input values are integers.
Input
The input is given from Standard Input in the following format:
Q
\mathrm{query}_1
\mathrm{query}_2
\vdots
\mathrm{query}_Q
In the $i$-th query, $\mathrm{query}_i$, the kind of query, $c_i$ (one of $1$, $2$, or $3$), is first given. If $c_i = 1$ or $c_i = 2$, an integer $x$ is additionally given.
In other words, each query is in one of the following three formats.
1 x
2 x
3
Output
Print $q$ lines, where $q$ is the number of queries such that $c_i=3$.
The $j$-th $(1\leq j\leq q)$ line should contain the answer to the $j$-th such query.
样例
9
1 2
1 10
3
1 3
3
2 2
3
1 10
3
8
1
9
0
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。