#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

struct Node {
    char name[100];
    struct Node* next;
};

struct Node* head = NULL;
struct Node* tail = NULL;

int isValidName(char *name) {
    for (int i = 0; name[i] != '\0'; i++) {
        if (!isalnum(name[i])) {   // not alphabet or digit
            return 0;
        }
    }
    return 1;
}

void insertAtTail(char *name) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    strcpy(ne