Given an empty binary search tree with no nodes, you are asked to perform 2 kinds of queries:

insert x - insert the value x in the BST

smallest k - print the kth smallest element in the BST

Given q queries, you are asked to write a program to perform these queries.

Input

The first line of the input contains a single number q (1 β€ q β€ 1000).

The next q lines contain queries. For all the insert queries, the value of x does not exceed in absolute value. For all the smallest queries, the value of k does not exceed the current tree size.

Output

For each smallest query, the program should print the smallest kth element in the binary search tree.