// editor1
#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node*next;
}s1;
struct Node *head=NULL,*tail=NULL;
void create(int num){
    s1 *newNode=(s1*)malloc(sizeof(s1));
    newNode->data=num;
    newNode->next=NULL;
    if(head==NULL){
        head=newNode;
        tail=newNode;
    }
    else{
        tail->next=newNode;
        tail=newNode;
    }
}

void display(){
    s1 *i;
    for(i=head;i!=NULL;i=i->next){
        printf("%d ",i->data);
    }
}
int main(){
    int i,num,size;
    scanf("%d",&size);
    if(size<0){
        printf("Invalid input");
        return 0;
    }
    for(i=0;i<size;i++){
        scanf("%d",&num);
        create(num);
        
    }
    delete();
    display();
    return 0;
}