In this problem you must create a Heap data structure to store the integers, where the following operations are defined:
Insert() - add to Heap the value ;
Extract - extract from the Heap the maximum element (and delete it).
The first line contains the number of commands (1 \le n \le 10^5), then a sequence of operations, each in a separate line.
Each command has the following format: "0 number" or "1", which means respectively the operations Insert (number) and Extract. The inserted numbers range from to 10^7 inclusive.
It is guaranteed that when the Extract command is executed, there is at least one element in the structure.
For each extraction command, print the number obtained by executing the Extract command.
Example 1