#include<stdio.h>
#include<stdlib.h>
int display();
int create (int sum);

typedef struct node{
    int data;
    struct node *next;
}node;

node *tail=NULL, *head=NULL, *newnode =NULL;

int main()
{
    int size,i,value;
   if( !(scanf("%d",&size))||size<0)
   {

        printf("Invalid input");
    }
    for(i=0;i<size;i++){
        if(!(scanf("%d",&value))){
            print("Invalid input");
        }
        create(value);
    }
       display();
       return 0;
}
    int create(int num)
    {
        newnode =(node*)malloc(sizeof(node));
        newnode->data=num;
        newnode->next=NULL;
        
        if(head==NULL)
        {
            head=newnode;
            tail=newnode;
        }
        else{
            tail->next=newnode;
            tail=newnode;
        }
        
    }
    int display()
    {
        node *temp;
        for(temp=head;temp!=NULL;temp=temp->next)
        {
        printf("%d ",temp->data);
        }
}