#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    int n;
    scanf("%d", &n);

    int shipments[n];
    int size = 0;

    for (int i = 0; i < n; i++) {
        char input[50];
        scanf("%s", input);

        // validate numeric input (allow negatives)
        for (int j = 0; j < strlen(input); j++) {
            if (!(isdigit(input[j]) || (j == 0 && input[j] == '-'))) {
                printf("Invalid Input");
                return 0;
            }
        }

        int newEntry = atoi(input);

        // shift existing elements to right
        for (int k = size; k > 0; k--) {
            shipments[k] = shipments[k-1];
        }
        shipments[0] = newEntry;  // add new entry at the front
        size++;
    }

    // print final stock list
    for (int i = 0; i < size; i++) {
        printf("%d", shipments[i]);
        if (i != size - 1) printf(" ");
    }

    return 0;
}