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