#include<stdio.h>
#include<stdio.h>
typedef struct doubly
{
    int data;
    struct node *prev,*next;
}node;
node *head=NULL,*tail=NULL;
void create (int num)
{
    node *nd=(node*)malloc(sizeof(node));
    nd->data=num;
    nd->prev=NULL;
    nd->next=NULL;
    if(head==NULL)
    {
        head=nd;
        tail=nd;
    }
    else
    {
        tail->next=nd->prev;
        nd->prev=tail->next;
        tail=nd;
    }
}
void print()
{
    for(int itr=1;itr->data!=NULL;itr++)
    {
        printf("%d",itr->data);
    }
}
int main()
{
    int size,num,itr;
    scanf("%d",&size);
    if(size<0)
    {
        printf("Invalid input");
        return 0;
    }
    else
    {
        for(int i=0;i<size;i++
        {
            scanf("%d",itr->data);
        }
        create (num);
    }
    print();
    return 0;
}