// editor2
#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));
    if(!newNode)
    {
        printf("Memory allocation failed.\n");
        exit(1);
    }
    newNode->data=data;
    newNode->next=NULL;
    return newNode;
}
void printList(struct Node*head)
{
    struct Node*temp=head;
    while(temp != NULL)
    {
        printf("%d",temp->data);
    }
    printf("\n");
}
int main()
{
    int  n;
    if(scanf("%d",&n)!=1 || n<0 || n>10)
    {
        printf("Invalid input\n");
        return 0;
    }
    struct Node*head=NULL;
    struct Node*tail=NULL;
    for(int i=0;i<n;i++)
    {
        int id;
        if(scanf("%d",&id)!i=1 || id<0 || id>1000)
        {
            printf("Invalid input\n");
        }
        struct Node*newNode=createNode(id);
        if(head==NULL)
        {
            head=newNode;
            tail=head;
        }
        else
        {
            tail->next=newNode;
            tail=newNode;
        }
    }
    printList(head);
    struct Node*temp;
    while(head!=NULL)
    {
        temp=head;
        head=head->next;
        free(temp);
    }
    return 0;
}