#include<stdio.h>
#include<stdlib.h>
int size=5,top=-1;

void push(){
    if(isFull()){
        printf("Stack is Full");
    }else{
        arr[++top];
    }
}

int isEmpty(){
    if (top ==-1){
        return -1;
    }else{
        return 0;
    }
}

int isFull(){
    if(top==size-1){
        return -1;
    }else{
        return 0;
    }
}

void pop(){
    if(isEmpty()){
        printf("Stack is Empty");
    }else{
        top--;
        arr[top];
    }
}

int main(){
    char choice[101];
    int num,n;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    for(i=0;i<n;i++){
        scanf("%d",&choice);
        if(choice == "PUSH"){
            scanf("%d",&num);
            push(num);
        }else if(choice =="POP"){
            pop();
        }else if(choice == "DISPLAY"){
            travesal();
        }else if(choice == "PEEK"){
            peek();
        }else{
            printf("Invalid input");
        }
        
        
    }
    return 0;
}