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