#include<stdio.h>
#include<stdlib.h>
    struct node{
        int data;
        struct node*next;
    };
    void push(struct node*head_ref,int new_data){
        struct node*new_node=(struct node*)malloc(sizeof(struct node));
        new_node->data=new_data;
        new_node->next=*head_ref;
        *head_ref=new_node;
        
    }
    void printlist(struct node*node){
        while(node!=NULL){
            printf("%d",node->data);
            node=node->next;
        }
    }
    int main(){
        int n;scanf("%d",&n);
        if(n<0){
            printf("Invalid input");
            return 0;
        }
        struct node*head=NULL;
        int value;
        for(int i=0;i<n;i++){
            scanf("%d",&value);
           push(&head,value);
        }
        printlist(head);
        return 0;
    }