#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
struct Node {
    char name[101];
    struct Node*next;
};
int isValidName(char *name) {
    for (int i=0; name[i]!='\0';i++){
        if (!isalnum(name[i])) {
            return 0;
        }
    }
    return 1;
}
int main(){
    int n;
    scanf("%d",&n);
    struct Node*head =NULL,*tail=NULL;
    for(int i=o;i<n;i++) {
        char temp[101];
        scanf("%s",temp);
        if(!isValidName(temp)){
            printf("Invalid input\n");
            return 0;
        }
        struct Node *newNode=(struct Node*)malloc(size of (struct Node));
             strcpy(newNode->name,temp);
             newNode->next=NULL;
             if (head ==NULL){
               head =newNode;
               tail =newNode;
             } else{
                 tail->next= newNode;
                 tail= newNode;
             }
    }
    struct Node *current =head;
    while (current != NULL) {
        printf("%s",current->name);
        if(current->next !=NULL) {
            printf("");
        }
        current=current->next;
    }
    printf("\n");
    return 0;
}
        }
    }