#include <stdio.h>
#include <stdlib.h>
typedef struct node{
    int data;
    struct node *next;
}nod;
int main(){
    int n;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    } 
    nod *head =NULL,*temp=NULL,*newNode=NULL:
    for(int i=0;i<n;i++){
        int x;
        if(scanf("%d",&x)!=1){
            printf("Invalid input");
            return 0;
        }
        newNode=(nod*)malloc(sizeof(nod));
        newNode->data=x;
        newNode->next=NULL;
        
        if(head==NULL){
            head=newNode;
            temp=newNode;
        }
    }
    temp=head;
    while(temp!=NULL){
        printf("%d",temp->next);
    }
    return 0;
}