// editor1

#include<stdio.h>
#include<stdlib.h>

typedef struct doubley
{
    int data;
    struct doubley *prev;
    struct doubley *next;
}node;

node *head=NULL,*tail=NULL;

void create(int n)
{
    node *nd=(node*)malloc(sizeof(node));
    nd->data=n;
    nd->prev=nd->next=NULL;
    if(head==NULL)
    {
        head=tail=nd;
    }
    else
    {
        tail->next=ned
        nd->prev=tail;
        tail=nd;
    }
}

void print()
{
    node *temp=head;
    while(temp!=NULL)
    {
        printf("%d",temp->data);
    }
}

void del();

int main()
{
    int n,data,val;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&data);
        create(data);
    }
    scanf("%d",&val);
    print();
}