#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Node{
    char data[100];
    struct Node* tail; 
};
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->next!=NULL)
        {
            temp=temp->next;
        }
        temp->next=newnode;
    }
    return 0;
}