In this problem, you need to build a Heap data structure and perform the following operations:
Insert(x) - adds the number to the Heap;
Extract - outputs the maximum element from the Heap (and removes it).
The first line contains an integer (1 ≤ n ≤ 10^5) indicating the number of operations. Then lines follow, each containing an operation. Each operation is given in the following format:
0 x - adds the number to the Heap (1 \le x \le 10^7).
1 - outputs the maximum element from the Heap (and removes it).
It is guaranteed that the operations will always be valid.
For each Extract operation, output the result on a separate line.
Example 1