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