Stack push / pop
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Simulate the operations with the stack:
push x — insert value into the stack;
pop — delete the top element;
top — print the top element (without deleting it);
All pop commands are correct.
If stack is empty and top command arrives, print nothing.
Input
Each line contains a single command.
Output
For each top command print on a separate line the corresponding result.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 52%