// editor5

#include<stdio.h>
#include<stdlib.h>

typedef struct Node{
    // struct Node *prev;
    struct Node *next;
    int data;
}Node;

typedef struct List{
    struct Node *head;
    struct Node *tail;
}List;

void init(List *clist){
    clist->head=NULL;
    clist->tail=NULL;
}

void addNode(List *list, int data){
    Node *newNode=(Node*)malloc(sizeof(Node));
    newNode->data=data;
    newNode->next=NULL;
    if(list->head==NULL){
        list->head=newNode;
        list->tail=newNode;
        return;
    }
    list->tail->next=newNode;
    list->tail=newNode;
}

void displayNodes(List *list){
    Node *itrNode= list->head;
    while(itrNode!=NULL){
        printf("%d ", itrNode->data);
        itrNode=itrNode-next;
    }
}

int main(){
    int n;
    scanf("%d", &n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    List clist;
    init(&clist);
    int data;
    for(int i=0;i<n;i++){
        scanf("%d ", &data);
        addNode(&clist, data);
    }
    
    displayNodes(&clist);
    
    return 0;
}