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