#include <stdio.h>
#include <stdlib.h>

struct LinkNode {
    int value;
    struct LinkNode *next;
};

int main() {
    int n;
    scanf("%d", &n);
    struct LinkNode *head = (struct LinkNode *)malloc(sizeof(struct LinkNode));
    struct LinkNode *tail = head;
    for (int i = 0; i < n; i++) {
        scanf("%d", &tail->value);
        if (i < n-1) {
            tail->next = (struct LinkNode *)malloc(sizeof(struct LinkNode));
            tail = tail->next;
        }
        tail->next = NULL;
    }
    tail = head;
    while (tail) {
        printf("%d ", tail->value);
        tail = tail->next;
    }
    while(head) {
        tail = head->next;
        free(head);
        head = tail;
    }
    return 0;
}