#include<stdio.h>
#include<stdlib.h>

typedef struct node{
    int data;
    struct node *next,*prev;
}node;

node *head=NULL,*tail=NULL;

int insert(int val){
    node *n = (node*)malloc(sizeof(node));
    n->data=val;
    n->next=NULL;
    n->prev=NULL;
    
    if(head==NULL){
        head=tail=n;
    }
    else{
        n->prev=tail;
        tail->next=n;
        tail=n;
    }
}

void deletion(int num){
    if(head->data==num){
        head=head->next;
        head->prev=NULL;
    }
    else if(tail->data==NULL){
        tail->prev->next=NULL;
    }
    else{
        while(i->data != num){
            i->prev->next=i->next;
          i->next=i->prev->next;
        }
    }
}
void display(){
    node *temp=head;
    while(temp!=NULL){
        printf("%d ",temp->data);
        temp=temp->next;
    }
}

int main(){
    int n,val;
    scanf("%d",&n);
    for(int i=0 ; i<n ; i++){
        scanf("%d",&val);
        insert(val);
    }
    display();
    
    return 0;
}