#include <iostream>
using namespace std;
class myStack{
public:
int size = 0;
int array[30];
bool isEmpty(){
return size == 0 ? true : false;
}
int getSize(){
return size;
}
int peek(){
return array[size-1];
}
int pop(){
int temp = array[size-1];
array[size-1] = 0;
size--;
return temp;
}
void push(int value){
array[size] = value;
size++;
}
};
int main() {
myStack test;
for(int i = 1; i <= 5; i++){
test.push(i);
}
cout<<test.getSize()<<endl;
cout<<test.peek()<<endl;
for(int i = 1; i <= 5; i++){
cout<<test.pop()<<endl;
}
if(test.isEmpty())cout<<"empty";
return 0;
}