English version is in beta. All contents of the site should be already translated (mostly using machine translation), and everything should work properly. However, if you find any problems, please contact me.
The problem statement has been automatically translated from Russian. If the statement is not clear, or you have any comments about it, please contact me. Anyway, I hope that someday I will fix the translation manually.

Simple stack

Implement the "stack" data structure. Write a program containing a description of the stack and simulating the operation of the stack, implementing all the methods listed here.  The program reads a sequence of commands and, depending on the command, performs one or another operation. After executing each command, the program should output one line. Possible commands for the program:

push n
Add the number n to the stack (the value of n is set after the command). The program should output ok.
pop
Remove the last element from the stack. The program should output its value.
back
The program should output the value of the last element without removing it from the stack.
size
The program should output the number of elements in the stack.
clear
The program should clear the stack and output ok.
exit
The program should output bye and shut down.

It is forbidden to use a standard stack, as well as standard dynamic arrays with functions like append/push_back. Write on an array of fixed length, with index pointers.

Input data

Stack management commands are entered in the format described earlier, 1 per line.

It is guaranteed that the set of input commands meets the following requirements: the maximum number of elements in the stack at any time does not exceed 100, all pop and back commands are correct, that is, when they are executed, at least one element is contained in the stack.

Output data

It is required to output the protocol of working with the stack, 1 message per line

Examples
Input data
push 3
push 14
size
clear
push 1
back
push 2
back
pop
size
pop
size
exit
Output data
ok
ok
2
ok
ok
1
ok
2
2
1
1
0
bye

This problem on informatics