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