Determined to improve her skills, Nikolle climbed the highest mountain known to humanity, going beyond the clouds. There, she found a monastery, where the great master Z lived. Training with him, Nikolle acquired powerful knowledge about competitive programming, such as Segment Tree Beats, Sweepline Mo, and 3D Hull Online.
After months of improvement, Nikolle returned to UnB and decided to share her knowledge with her peers. However, before delving into overly complex topics, she decided to propose a simpler challenge: to implement the weakest data structure she knows, the Serpistent Teg.
A Serpistent Teg maintains a list of stacks, initially with no stacks. The structure supports the following operations:
Show Nikolle that you have what it takes to learn her techniques!
The first line of the input contains an integer $$$Q$$$: the number of operations to be performed $$$(1 \leq Q \leq 100)$$$.
Each of the next $$$Q$$$ lines describes an operation to be performed, and the operations must be executed in the order they are given in the input. These lines start with an integer $$$t$$$, indicating the type of operation according to the statement $$$(1 \leq t \leq 3)$$$.
For every operation of type $$$3$$$, print the $$$j$$$-th number added to stack $$$i$$$. Print only one number per line, in the order they appear in the input.
1312 1 33 1 112 1 42 2 53 2 13 1 212 3 12 3 23 3 23 1 1
3 5 4 2 3