#include<stdio.h>
#include<stdlib.h>
struct node{
    int data;
    struct node*next;
}:
struct node*createnode(int data){
    struct node*newnode=(struct node*)malloc(sizeof(struct node));
    newnode->data=data;
    newnode->next=NULL;
    return newnode;
}
int main(){
    int n;
    if(scanf("%d",&n)!=1){
        printf("Invalid Input");
        return 0;
    }
    if(n<0||n>10){
        printf("Invalid Input");
        return 0;
    }
    struct node*head=NULL;
    struct node*tail=NULL;
    for(int i=0;i<n;i++){
        int x;
        if(scanf("%d",&x)!=1||x<0||x<-1000||x>1000){
            printf("Invalid Input");
            return 0;
        }
        struct node*newnode=createnode(x);
        if(head==NULL){
            head=newnode;
            tail=nnewnode;
        }
        else{
            tail->next=newnode;
            tail=newnode;
        }
    }
    struct node*temp=head;
    while(temp != NULL){
        printf("%d",temp->data);
        temp=temp->next;
}
return 0;
}