// editor3
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
typedef struct Node{
int data;
struct Node*prev;
struct Node*next;
}Node;
Node*createNode(int data){
    Node*newNode=(Node*)malloc(sizeof(Node));
    if(!newNode){
         printf("Memory allocation error\n");
         exit(1);
    }
      newNode->data=data;
      newNode->prev=NULL;
      newNode->next=NULL;
      return newNode;
}
  void insertEnd(Node**head,int data){
      if(*head==NULL)
      {
          *head=newNode;
          return;
      }
      Node*temp=*head;
      while(temp->next!=NULL){
          temp=temp->next;
      }
      temp->next=newNode;
      newNode->prev=temp;
  }
   void printList(Node*head){
       Node*temp=head;
       while(temp!=NULL){
           printf("%d",temp->data);
           temp=temp->next;
       }
       printf("\n");
   }
    int main(){
        int n;
        if(scanf("%d",&n)!=1||n<=0){
            printf("Invaild input\n");
            return 0;
        }
        Node*head=NULL;
        for (int i=0;i<n;i++){
            int val;
            if(scanf("%d",&val)!=1){
                printf("Invalid input\n");
                return 0;
            }
            insertEnd(&head,val);
        }
        printList(head);
        return 0;
    }