#include<stdio.h>
#include<stdlib.h>
struct node
{
    int data;
    struct node *next,*pre;
};
struct node *head=NULL;

struct node*creation (int val)
{
    struct node *newnode=(struct node*)malloc(sizeof(struct node));
    newnode->data=val;
    newnode->next=NULL;
    newnode->pre=NULL;
    return newnode;
}
struct node* insert(int val)
{
    struct node*newnode=creation(val);
    if(head==NULL)
    {
        head=newnode;
        head->next=NULL;
        head->pre=NULL;
    }
    else
    {
        struct node*temp;
        temp=head;
        while(temp->next!=NULL)
        {
            temp=temp->next;
        }
        temp=newnode;
        temp->next=NULL;
        newnode->pre=temp;
    }
}
int main()
{
    int n,i=0;
    scanf("%d",&n);
    while(i<n)
    {
        int x;
        scanf("%d",&x);
        insert(x);
    }
    struct node*temp;
    temp=head;
    while(temp!=NULL)
    {
        printf("%d",temp->data);
        temp=temp->next;
    }
}