| The 2023 CCPC Online Contest |
|---|
| Finished |
The memory limit of this problem (4 megabytes) is unusual!
There are many islands separated by the Byte Ocean. Clever people invented the flying ship such that they can travel to other lands. Today, millions of salesmen gather at Byteland to celebrate the annual international trading festival. You are maintaining the trading database here. Initially, the database is empty, then $$$q$$$ events will happen, each is one of the following two types:
Due to the low level of technology in Byteland, the space of the database is very limited, but you still need to maintain the database efficiently.
The first line of the input contains a single integer $$$q$$$ ($$$1 \leq q \leq 1\,000\,000$$$), denoting the number of events.
Each of the next $$$q$$$ lines describes an event in formats described in the statement above, except that some parameters are encrypted in order to enforce online processing.
Let $$$last$$$ be the previous price that you answered. Note that $$$last$$$ should be reset to $$$0$$$ at the beginning of the input. For each operation, $$$x$$$, $$$y$$$ and $$$w$$$ are encrypted: their actual values are $$$x \oplus last$$$, $$$y \oplus last$$$ and $$$w \oplus last$$$. In the expressions above, the symbol "$$$\oplus$$$" denotes the bitwise exclusive-or operation. Also, note that the constraints described in the statement above apply to the corresponding parameters only after decryption, the encrypted values are not subject to those constraints.
For each query, print a single line containing a single integer, denoting the price of the good that you find, or zero if there is no finding.
5 1 2 3 1 1 4 5 2 2 2 2 2 3 7 2 3 4
2 1 0
| Name |
|---|


