#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>

struct Node{
    int data
    struct Node*next;
}

struct Node*createNode(int data){
    struct Node*newNode=(struct Node*)malioc(sizeof(struct Node));
    newNode->data = data;
    newNode->next=NULL;
    return newNode;
}
void displayList(struct Node*head){
    struct Node*temp = head;
    while(temp!=NULL){
        printf("%d",temp->data);
        temp=temp->next;
        
    }
}
int main(){
    int n,data
    struct Node*head=null,*temp=NULL;
    
    if(scanf("%d",&n)!=1||n<=0||n>10){
        printf("Invalid input");
        return 0;
    }
    for(int i=0;i<n;i++){
        if(scanf("%d",&data)!=1||data<-1000||data >1000){
            printf("Invalid input");
            return 0;
        }
        struct Node*newNode =createNode(data);
        
        if(head ==NULL)
           head=newNode;
         else
            temp->next=newNode;
            
        temp =newNode;
    }
    
    displayList(head);
    return 0;
}
    }
}