#include<stdio.h>
#include<stdlib.h>
typedef struct node{
    char data[20];
    struct node*prev;
    struct node*next;
}Node;
Node *head=NULL,*tail;
Node*create(char*ch){
    Node*newNode=(Node*)malloc(sizeof(Node));
    strcpy(newNode->data,ch);
    newNode->next=NULL;
    if(head==NULL){
        head=newNode;
        tail=newNode;
    }
    else{
        tail->next=newNode;
        newNode->prev=tail;
        tail=newNode;
    }
}
void display(){
    Node*itr;
    for(itr=head;itr!=NULL;itr=itr->prev)
    printf("%s ",itr->data);
}
int main(){
    int i,num,n;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    char ch[n];
    for(i=0;i<n;i++){
        if(scanf("%s",&ch)!=1){
        break;
    
        }
        else{
            create(ch);
        }
    }
    display();
    return 0;
    
}