You maintain a data structure S that holds natural numbers. S starts empty, and the same number can be inserted more than once. Inserting the same value twice leaves S with two elements.
Process the following two query types in the order they are given.
Type 1: insert the natural number X into S.
Type 2: sort the elements of S in increasing order, print the X-th one, and remove that single element from S.
Input
The first line contains the number of queries N. (1≤N≤2×106)
Each of the next N lines contains one query as two integers TX.
If T is 1, then X is the value to insert into S. (1≤X≤2×106)
If T is 2, then X says which smallest element to remove. S is guaranteed to hold at least X elements at that moment.
Output
For each type 2 query, print the answer on its own line, in the order the queries are given. If there is no type 2 query, print nothing.