#include<stdio.h>

int top = -1,n;

int isFull(){
    if(top == n){
        return 1;
    }
    else {
        return 0;
    }
}

void push(int *arr,int num){
    if(isFull){
        printf("Stack is Full");
    }
    else{
        arr[++top] = num;
    }
    printf("%d ",arr[i]);
}

void display(int *arr){
    for(int i=0;i<top;i++){
        printf("%d ",arr[i]);
    }
}



int main(){
    char choice[20];
    int num;
    scanf("%d",&n);
    int arr[n];
    for(int i=0;i<n;i++){
        scanf("%s",choice);
        if(choice == "PUSH"){
            scanf("%d",&num);
            push(arr,num);
        }
        else if(choice == "POP"){
            // pop();
        }
        else if(choice == "DISPLAY"){
            display(arr);
        }
        else if(choice == "PEEK"){
            // peek();
        }
    }
}