#include<stdio.h>
#include<stdlib.h>
struct node3{
    int data;
    struct Node*next;
};
struct Node*push(struct Node*top,int data){
    struct node*
    newNode=(struct Node*)malloc(sizeof(struct Node));
    if(newNode==NULL){
        printf("Memory allocation failed!n");
        exit(1)
    }
    newNode->data=data;
    newNode->next=top;
    return newNode;
}
Void display(struct Node*top){
    struct Node*current=top;
    if(current==NULL){
        return;
    }
    display(current->next);
    printf("%d",current->data)
}
int main(){
    struct Node*top=NULL;
    int n,data;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input\n");
        return 0;
    }
    for(int i=0;i<n;i++){
        scanf("%d",&data);
        top=push(top,data);
    }
    display(top);
    printf("\n")
    while(top!=NULL){
    temp=top;
    top=top->next;
    free(temp);
    }
    return 0;
}