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