#include<stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    struct Node *prev,*next;
    
};
void insert(struct Node**head,struct Node **tail,int data){
    struct Node*newNode=(struct Node*)malloc(sizeof(struct Node));
    newNode->data=data;
    newNode->prev=NULL;
    newNode->next=*head;
    if(*head==NULL){
        *head=newNode;
        *tail=newNode;
    }
    else{
        (*tail)->next=newNode;
        newNode->prev=*tail;
        *tail=newNode;
    }
}
void print(struct Node*head){
    struct Node*curr=head;
    while(curr!=NULL){
        printf("%d ",curr->data);
        curr=curr->next;
    }
}
int main(){
    int n,temp;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    struct Node*head=NULL,*tail=NULL;
    for(int i=0;i<n;i++){
        scanf("%d",&temp);
        insert(&head,&tail,temp);
    }
    print(head);
    return 0;
}