Bugcat is currently managing a queue. Bugcat has a specific preference: it does not want any duplicate numbers to appear in the queue at the same time. Additionally, all numbers entering the queue must be within the range $$$[1, m]$$$.
You need to process $$$Q$$$ operations. There are three types of operations:
Your task is to output the result for every Type $$$3$$$ operation.
The first line contains two integers: $$$Q$$$ (the number of operations) and $$$m$$$ (the maximum value of elements), where $$$1 \le Q, m \le 10^6$$$.
The next $$$Q$$$ lines describe the operations:
For each Type $$$3$$$ operation, print the result on a new line.
10 101 31 523 13 21 31 51 83 23 3
5 -1 3 8