#include<stdio.h>
#include<stdlib.h>

typedef struct data{
    int data;
    struct node *next;
}Node;

Node *head=NULL, *tail;

int create(int num){
    Node *newNode = (Node*) malloc (1*sizeof(Node));
    newNode->data = num;
    newNode->next = NULL;
    if(head == NULL){
        head = newNode;
        tail = newNode;
    }
    else{
        tail->data = newNode;
        tail = newNode;
    }
}
void del(int value){
    first = head;
    second = head->next;
    if(value == head->data){
        head = head->next;
    }
    else{
        while(second !=NULL){
            if(second->data==value){
                first->next=second->next;
            }
            first = first ->next;
            second = second->next;
        }
    }
    
void display(){
    int itr;
    for(head=itr;itr!=NULL;itr=itr->next){
        printf("%d",itr->data);
        }
    }
int main(){
    int num,size,itr;
    scanf("%d",&size);
    if(size<0){
        printf("Invalid input");
        return 0;
    }
    for(itr=0;itr<size;itr=itr->next){
        if(!scanf("%d",&num)){
            printf("Invalid input");
            return 0;
        }
    }
}
}