#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
typedef struct Node {
  int data;
  struct Node*prev;
  struct Node*next;
  }Node;
  void append(Node** head,int value){
   Node*newNode =(Node*)malloc(sizeof(Node));
   newNode->data =value;
   newNode->prev =NULL;
   newNode->next =NULL;
    if(*head== NULL){
    *head = newNode;
    }else{
    Node*temp= *head;
    while(temp->next !=NULL)
    temp =temp->next;
    temp->next=newNode;
    newNode->prev=temp;
    }
    }
    void printList(Node*head){
    while(head != NULL){
    printf("%d",head->data);
    head = head->next;
    }
    }
    
    int main(){
    int n;
    if (scanf("%d", &n !=1 || n<=0){
    printf("Invalid input\n");
    return 0;
    }
    Node*head =NULL;
    for( int i=0;i<n;i++)
    int id;
    if(scanf("%d",&id) !=1){
    printf("invalid input\n");
    return 0;
    }
    append(&head ,id);
    }
    printList(head):
    return 0;
    }