**Problem
**

Data Manager is a sophisticated data structure, which manages a set of data and fulfills operations on the data set. There are 3 kinds of operations:

*add n*£¬which means adding integer n to the data set;*delete*, which means deleting the smallest integer from the data set. If the data set is empty, ignore this operation. If there are more than one smallest integers, only delete one of them.*query*, which means printing the smallest integer in the data set. If the data set is empty, ignore this operation.

Given a list of operations, you are to predict the output of the Data Manager. At the beginning, the Data Manager is empty.

**Input**

There is only one test case. In the first line, an integer T (T <= 500000) will be given, which is the number of operations. The next T lines contains T operations.

**Output **

Give output of the Data Manager, one query per line.

**Sample Input**

10

add 1

add 100

add -1

query

delete

query

add 2046

query

delete

query

**Sample Output**

-1

1

1

100