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