{"raw_statement":[{"iden":"problem statement","content":"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.\nThe query is of one of the following three kinds:\n\n*   `1 x` : write an $x$ on the blackboard.\n    \n*   `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.\n    \n*   `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.\n    \n\nWhat is bitwise XOR? The bitwise XOR of non-negative integers $A$ and $B$, $A \\oplus B$, is defined as follows.\n\n*   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.\n\nFor instance, $3 \\oplus 5 = 6$ (in binary: $011 \\oplus 101 = 110$)."},{"iden":"constraints","content":"*   $1\\leq Q \\leq 3\\times 10^5$\n*   $0\\leq x < 2 ^{30}$\n*   When a query $2$ is given, at least one $x$ is written on the blackboard.\n*   When a query $3$ is given, at least two integers are written on the blackboard.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$Q$\n$\\mathrm{query}_1$\n$\\mathrm{query}_2$\n$\\vdots$\n$\\mathrm{query}_Q$\n\nIn 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.\nIn other words, each query is in one of the following three formats.\n\n$1$ $x$\n\n$2$ $x$\n\n$3$"},{"iden":"sample input 1","content":"9\n1 2\n1 10\n3\n1 3\n3\n2 2\n3\n1 10\n3"},{"iden":"sample output 1","content":"8\n1\n9\n0\n\nAfter processing the $1$\\-st query, a $2$ is written on the blackboard.\nAfter processing the $2$\\-nd query, a $2$ and a $10$ are written on the blackboard.\nWhen processing the $3$\\-rd query, the minimum possible bitwise XOR of two of the integers written on the backboard is $2\\oplus 10=8$.\nAfter processing the $4$\\-th query, a $2$, a $3$, and a $10$ are written on the blackboard.\nWhen processing the $5$\\-th query, the minimum possible bitwise XOR of two of the integers written on the backboard is $2\\oplus 3=1$.\nAfter processing the $6$\\-th query, a $3$ and a $10$ are written on the blackboard.\nWhen processing the $7$\\-th query, the minimum possible bitwise XOR of two of the integers written on the backboard is $3\\oplus 10=9$.\nAfter processing the $8$\\-th query, a $3$ and two $10$s are written on the blackboard.\nWhen processing the $9$\\-th query, the minimum possible bitwise XOR of two of the integers written on the backboard is $10\\oplus 10=0$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}