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