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