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