// ambrisan
#include<stdio.h>
#include<stdlib.h>
struct node{
    int dat;
    struct node* next;
};
int main()
{
    int a;
    scanf("%d",&a);
    if(n<=0||n>10){
        printf("invalid input");
        return 0;
    }
    struct node* head=NULL;
    struct node* temp=NULL;
    struct node* newnode=NULL;
    for(int i=0;i<a;i++){
        int value;
        if(scanf("%d",&value)!=1)
        {
            printf("Invalid input");
        }
        if(value<1000||value>1000)
        {
            printf("Invalid input");
        }
        newnode=(struct node*)malloc(sizeof(struct node));
        newnode->data=value;
        newnode->next=NULL;
        if(head==NULL){
            head=newnode;
            temp=head;
        }else{
            temp->next=newnode;
            temp=temp->next;
        }
    }
    temp=head;
    while(temp!=NULL){
        printf("%d ",temp->data);
        temp=temp->next;
    }
    return 0;
    }
}