#include<stdio.h>
#include<string.h>
#include<stdlib.h>

typedef struct node{
    char data[101];
    struct node *prev;
    struct node *next;
}Node;

Node *head =NULL,*tail;


void create(char *ch){
    Node *newNode =(Node*)malloc(1 * sizeof(Node));
    strcpy(newNode->data,ch);
    newNode->prev=NULL;
    newNode->next=NULL;
    if(head==NULL){
        head=newNode;
        tail=newNode;
        
    }
    else{
        tail->next=newNode;
        tail=newNode;
        
    }
}

void display(){
    Node *itr=tail;
    for(itr!=head;itr=itr->prev){
        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;
    }
}