# Problem: Stacks

Want to try solving this problem? You can submit your code online if you log in or register.

## Stacks

**Input File:** `stacksin.txt`

**Output File:** `stacksout.txt`

**Time limit:** `1 seconds`

Implement a stack and show it off by writing a programme which
reads numbers from stacksin.txt. After each number, print out
the contents of the stack. If

`p` is given instead of a number,
pop the top item off the stack and then print its contents. If

`q` is given, quit. If the stack is empty after a pop, print
'stack is empty!'.

You may assume that your stack does not grow beyond 100 levels deep.

Sample input:

1
2
3
p
p
4
p
p
q

Sample output:

1
1 2
1 2 3
1 2
1
1 4
1
stack is empty!