#include<sydio.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));
    newNode->data = data;
    newNode->next = NULL;
    return newNode;
}
void display(struct Node*head){
    struct Node*temp = head;
    while(temo != NULL){
        printf("%d",temp->data);
        temp = temp->next;
    }
}
int main(){
    int n;
    if(scanf("%d", &n) != 1 || n < 0 || n > 10) {
        printf("Invalid input");
        return 0;
    }
    struct Node*head = NULL;
    struct Node*tail = NULL;
    for(int i = 0; i < n; i++) {
        int val;
        if(scanf("%d", &val) != 1) {
            printf("Invalid input");
            return 0;
        }
        if(val <-1000 || val > 1000) {
            printf("Invalid input");
            return 0;
        }
        struct Node*newNode = createNode(val);
        if(head == NULL) {
            head = tail = newNode;
        } else {
            tail->next = newNode;
            tail = newNode;
        }
    }
    display(head);
    return 0;
}