// editor1
#include<stdio.h>
#include<stdlib.h>

struct node{
    int id;
    struct node*next;
};
struct node*head=NULL;

void createnode(int a){
}

void insertnode(int a){
    temp=head;
    if(head==NULL){
        head->id=a;
        head->next=temp;
        temp=NULL;
    }
    else{
        temp->id=a;
        temp->next=temp;
        temp=NULL;
    }
}

void display(){
    temp=head;
    for(int i=0;i<n;i++){
        printf("%d",temp->id);
        temp=temp->next;
    }
}

int main(){
    int n;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    struct node*newnode;
    for(int i=0;i<n;i++){
        scanf("%d",&id);
        newnode=(int*)malloc(sizeof(int));
        insertnode(id);
    }
}