#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct Node{
    char data[100];
    struct Node *next;
};
struct Node *head=NULL;
int createList(){
    struct Node* newnode=(struct Node*)malloc(sizeof(struct Node));
    scanf("%s ", newnode->data);
    newnode->next=NULL;
    int len=strlen(newnode->data);
    for(int i=0;i<len;i++)
    {
        if((newnode->data[i]>='A' && newnode->data[i]<='Z') || (newnode->data[i]>='a'  && newnode->data[i]<='z') || (newnode->data[i]>='0' && newnode->data[i]>='9'))
        {
            continue;
        }
        else
        {
            printf("Invalid input");
            return -1;
        }
    }
    struct node *temp;
    if(head==NULL)
    {
        head=temp=newnode;
    }
    else
    {
        temp=head;
        while(temp->tail!=NULL)
        {
            temp=temp->tail;
        }
        temp->tail=newnode;
    }
    return 0;
}