#include<stdio.h>
#include<stdlib.h>

struct node {
    int data;
    struct node*mnext;
};

int main() {
    int n, value;
    struct node *head =NULL, *temp =NULL, *newNode = NULL;
    
    scanf("%d", &n);
    
    if (n < 0) {
        printf("Invalid input");
        return 0;
    }
    
    for (int i = 0; i < n; i++) {
        if (scanf("%d", &value) != 1) {
            printf("Invalid input");
            return 0;
        }
        
        newNode = (struct Node*)malloc(sizeof(struct Node));
        newNode->data = value;
        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;
}