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