11130 - Stack   

Description

Please implement the three basic stack operations.

Input

There are 3 kinds of stack operations(<50000) in the input, including
"push i": Push i on the stack, where i is an integer.
"pop": Pop the stack. Do nothing when the stack is empty.
"top": Output the top of the stack. Output "X" when the stack is empty.

Output

When a top operation is executed, output the top value of the stack.

Sample Input  Download

Sample Output  Download

Tags




Discuss