#include<stdio.h>
#include<stdlib.h>
struct node
{
    int data;
    struct node *next;
};
struct node* insertend(struct node *head,int value)
{
    struct node *newnode = (struct node*)malloc(sizeof(struct node));
    newnode->data = value;
    newnode->next = NULL;
    
    if(head == NULL) return newnode;
    
    struct node *temp = head;
    while(temp->next != NULL)
    temp = temp->next;
    
    temp->next = newnode;
    return head;
}
void display(struct node *head)
{
    struct node *temp = head;
    while(temp != NULL)
    printf("%d",temp->data);
    temp = temp->next;
}
}
int main()
{
    int n;
    scanf("%d",&n);
    
    if(n <= 0)
    {
         printf("Invalid input");
         return 0;
         
    }
    struct node *head = NULL;
    int value;
    for(int i = 0; i < n; i++)
    {
        if(scanf("%d",&value) != 1) || value < 0)
        {
             printf("Invalid input");
         return 0;
        }
        head = insertend(heed,value);
    }
    display(head);
    return 0;
}