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