Stack

No attempts yetTime limit0.5sMemory limit256 MB

Problem

Implement a stack of integers and process the commands from the input in order.

There are five commands.

  • push X: put the integer XX on the stack.
  • pop: remove the integer on top of the stack and print it. Print 1-1 when the stack is empty.
  • size: print how many integers the stack holds.
  • empty: print 11 when the stack is empty, otherwise 00.
  • top: print the integer on top of the stack. Print 1-1 when the stack is empty.

Input

The first line holds the number of commands NN (1N100001 \le N \le 10000). Each of the next NN lines holds one command. The integer XX of a push command satisfies 1X1000001 \le X \le 100000. No command outside the list above is given.

Output

For every command that prints something, print its result on its own line, in the order the commands are given.