#include<stdio.h>
#include<stdlib.h>

struct Node {
    int data;
    struct Node*next;
};
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;
        }
       
       
        if (head == NULL) {
            head = newNode;
            temp = head;
        } else {
            temp->next = newNode;
            temp = newNode;
        }
    }
     temp = head;
    while (temp != NULL) {
        printf("%d ", temp->data);
        temp = temp->next;
    }
    
    return 0;
    
}