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