#include<stdio.h>
#include<stdlib.h>

struct Node{
    int data;
    struct Node* next;
};

struct Node* createNode(int val){
    struct Node* n=(struct Node *)maclloc(sizeof(struct Node));
    n->data=val;
    n->next=NULL;
    return n;
    
}
void insertElements(struct Node** head,inta){
    struct Node* newNode(a);
    if(*head==NULL){
        *head=newNode;
        return ;
        
    }
    struct Node* temp=*head;
    while(temp->next!=NULL){
        temp=temp->next;
    }
    temp->next=newNode;
}
void display(struct Node* head){
    struct Node*temp=head;
    
}
int main(){
    struct Node* head=NULL;
    int n;
    scanf("%d",&n);
    if(n<=0){
        printf("Invalid input");
        return 0;
        
    }
    for(int i=0;i<n;i++){
        int a;
        scanf("%d",&a);
        insertElements(&head,a);
        
    }
    display(head);
    
}