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