#include<stdio.h>
#include<stdlib.h>
struct node{
    int data;
    struct node*prev,*next;
};
int main(){
    intn,x;
    struct node*head=NULL,*tail=NULL,*p;
    if(scanf("%d",&n)!=1||n<=0||n>10){
        printf("invalid input");
        return 0;
    }
    for(int i=0;i<n;i++){
        if(scanf("&d",&x)!=1||x<-10000||x>10000){
            printf("invalid input");
            return 0;
        }
        p=(struct node*)malloc(sizeof(struct node));
        p->data=x;p->prev=tail;p->next=NULL;
        if(!head)head=p;else tail->next=p;
        tail=p;
    }
    for(p=head;p;p=p->next)printf("%d",p->data);
    return 0;
}