#include<stdio.h>
#include<string.h>
#define SIZE 5
int stack[SIZE],top=-1;
void push()
{
    int stack[SIZE],top,x;
    if(top==SIZE-1)
    {
        printf("Stack overflow\n");
    }
    else{
        stack[top]=x;
        top++;
        printf("%d\n",sta)
    }
}
void peek()
{
    if(top==-1)
    {
        printf("Stack is empty\n");
    }
    else{
        printf("%d\n",stack[top]);
    }
}

int main(){
    int n;
    scanf("%d", &n);
    for(int i=0;i<n;i++){
        char command[10];
        scanf("%s", command);
        if(strcmp(command, "push")==0)
        {
            int x;
            scanf("%d", &x);
            push(x);
        }
        else if(strcmp(command, "peek")==0)
        {
            peek();
        }
    }
    return 0;
}