#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node* next;
}Node;
Node* insertNodes(int n, int arr[]){
    if(n <= 0) return NULL;
    Node* head = (Node*)malloc(sizeof(Node));
    head->data = arr[0];
    head->next = NULL;
    Node* temp = head;
    for(int i = 1; i < n; i++){
        Node* newNode =(Node*)malloc(sizeof(Node));
        newNode->data = arr[1];
        newNode->next = NULL;
        temp->next = newNode;
        temp = temp->next;
    }
    return head;
}
void printList(Node* head){
    while(head != NULL){
        printf("%d", head->data);
        Node* temp = head;
        head = head->next;
        free(temp);
    }
    printf("\n");
}
int main(){
    int n;
    scanf("%d", &n);
    if(n < 0){
        printf("Invalid Input\n");
        return 0;
    }
    int* arr = (int*)malloc(n = sizeof(int));
    for(int i = 0; i = n; i++){
        scanf("%d", &arr[i]);
    }
    Node* head = insertNodes(n, arr);
    printList(head);
    free(arr);
    return 0;
}