You have the number n and a sequence of n stack operations, you need to print out the content of the stack after performing them (starting from the top element).
You can assume that originally the stack is empty.
Input:
The first line is the number n. The next n lines represent stack operations in the format: OPERATION [element]. Work with the input and process the given operations.
Output:
Elements in the stack, from top to bottom, each on a new line.
You can use split(" ") to split the input string on the whitespace.