#include<stdio.h>
#include<stdlib.>
#include<string.h>
typedef struct Node {
    int data[20];
    struct Node*next;
    struct Node*prev;
    
}Node;
Node*head=NULL,*tail;
void create(char *ch)
{
    Node *newnode=(Node*)malloc(sizeof(Node));
    strcpy(newnode->data,ch);
    newnode->next=NULL;
    newnode->prev=NULL;
    if(head==NULL)
    {
        head=newnode;
        tail=newnode;
    }
    else{
        
        newnode->prev=tail;
        tail->next=newnode;
        tail=newnode;
    }
}
void dispaly(){
    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);
    }
    dispaly();
    return 0;
}