{"raw_statement":[{"iden":"problem statement","content":"We have a variable $X$ and $N$ kinds of operations that change the value of $X$. Operation $i$ is represented as a pair of integers $(T_i,A_i)$, and is the following operation:\n\n*   if $T_i=1$, it replaces the value of $X$ with $X\\ {\\rm and}\\ A_i$;\n*   if $T_i=2$, it replaces the value of $X$ with $X\\ {\\rm or}\\ A_i$;\n*   if $T_i=3$, it replaces the value of $X$ with $X\\ {\\rm xor}\\ A_i$.\n\nInitialize $X$ with the value of $C$ and execute the following procedures in order:\n\n*   Perform Operation $1$, and then print the resulting value of $X$.\n*   Next, perform Operation $1, 2$ in this order, and then print the value of $X$.\n*   Next, perform Operation $1, 2, 3$ in this order, and then print the value of $X$.\n*   $\\vdots$\n*   Next, perform Operation $1, 2, \\ldots, N$ in this order, and then print the value of $X$.\n\nWhat are ${\\rm and}, {\\rm or}, {\\rm xor}$?The ${\\rm and}, {\\rm or}, {\\rm xor}$ of non-negative integers $A$ and $B$ are defined as follows:\n\n*   When $A\\ {\\rm and}\\ B$ is written in base two, the digit in the $2^k$'s place ($k \\geq 0$) is $1$ if both of the digits in that place of $A$ and $B$ are $1$, and $0$ otherwise.\n*   When $A\\ {\\rm or}\\ B$ is written in base two, the digit in the $2^k$'s place ($k \\geq 0$) is $1$ if at least one of the digits in that place of $A$ and $B$ is $1$, and $0$ otherwise.\n*   When $A\\ {\\rm xor}\\ B$ is written in base two, the digit in the $2^k$'s place ($k \\geq 0$) is $1$ if exactly one of the digits in that place of $A$ and $B$ is $1$, and $0$ otherwise.\n\nFor example, $3\\ {\\rm and}\\ 5 = 1$, $3\\ {\\rm or}\\ 5 = 7$, and $3\\ {\\rm xor}\\ 5 = 6$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2\\times 10^5$\n*   $1\\leq T_i \\leq 3$\n*   $0\\leq A_i \\lt 2^{30}$\n*   $0\\leq C \\lt 2^{30}$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $C$\n$T_1$ $A_1$\n$T_2$ $A_2$\n$\\vdots$\n$T_N$ $A_N$"},{"iden":"sample input 1","content":"3 10\n3 3\n2 5\n1 12"},{"iden":"sample output 1","content":"9\n15\n12\n\nThe initial value of $X$ is $10$.\n\n*   Operation $1$ changes $X$ to $9$.\n*   Next, Operation $1$ changes $X$ to $10$, and then Operation $2$ changes it to $15$.\n*   Next, Operation $1$ changes $X$ to $12$, and then Operation $2$ changes it to $13$, and then Operation $3$ changes it to $12$."},{"iden":"sample input 2","content":"9 12\n1 1\n2 2\n3 3\n1 4\n2 5\n3 6\n1 7\n2 8\n3 9"},{"iden":"sample output 2","content":"0\n2\n1\n0\n5\n3\n3\n11\n2"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}