In the data structure, it is required to perform the following operations:
Add the element x to the end of the structure.
Remove the element from the end of the structure.
Find the minimum element in the structure.
The first line provides the number of operations n~(1 \le n \le 10^6). The next lines each consist of one of the following types of operations:
1 x - adds the element x.
2 - removes the element from the end.
3 - finds the minimum element.
x\:(-10^9 \le x \le 10^9) and all operations are guaranteed to be valid.
Provide the result of the 3 operation on each line.
Example 1