k-th Maximum#265

k-th Maximum

1 second
128 megabytes
Medium (≈1350)

In this task, you need to execute the following three types of queries:

Input

The first line contains an integer (n ≤ 10^5) indicating the number of queries. Each of the next lines contains queries in the format c k (c=+1, -1, 0 and |k| ≤ 10^9). It is guaranteed that at the time of the query, the k-th maximum exists in the set.

Output

For each 0 k query, print the k-th largest element in the set on a new line.

Examples

Example 1

Loading
Loading