Please implement the three basic stack operations, push, pop, and top.
#include <stack> or <queue> are not allowed.
The first line contains a 32-bit integer specifying the capacity of stack.
The subsequent input lines contain 3 types of stack operations (<50000).
The operations and the corresponding outputs are described below.
"push i": Push i into the stack, where i is a 32-bit integer.
We do not need to output anything if this operation is performed successfully.
However, if the stack is full, output "Full" and do nothing to the stack.
"pop": Pop one element from the stack.
We do not need to output anything if this operation is performed successfully.
We do not need to output anything when the stack is empty.
"top": Output the top element of the stack.
Output "X" and do nothing to the stack when the stack is empty.