#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node *next;
}node;

node *head=NULL;

void insert(int num){
    node *newnode=(node*)malloc(1*sizeof(node));
    newnode->data=num;
    newnode->next=newnode;
    if(head==NULL){
        head=newnode;
    }
    else{
        newnode->next=head->next;
        head->next=newnode;
    }
}

void display(){
    node *temp=head->next;
    do{
        printf("%d",temp->data);
    }while(temp!=head->next)
}

int main(){
    int n,num;
    scanf("%d",&n);
    if(n<=0){
        printf("Invalid input");
        return 0;
    }
    for(int i=1;i<=n;i++){
        scanf("%d",&num);
        insert(num);
    }
    display();
    return 0;
}