Implement the Stack#206

Implement the Stack

2 seconds
128 megabytes
Very easy (≈850)

Lale has just learned about a new and fashionable structure. That structure has push and pop methods.

Implement the stack with two operations.

Operation 1 - inserts a number into the stack.

Operation 2 removes the top element from the stack.

Note: For each 2 operation, print the value of the removed element. It is guaranteed that all operations are valid.

Input

The first line contains the integer n~(1 \le n \le 10^5) indicating the number of operations. The next lines specify the operation, where the first number indicates the operation type and the second number indicates the number to be added (only for the "first" operation), which is a positive number not greater than 10^5.

Output

Print all removed elements, each on a new line.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading