#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
struct Node {
    char name [100];
    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 nodes[1000];
for (int i=0; i<n; i++) {
    scanf("%s",nodes[i].name);
    if (!isVaildName(nodes[i].name)) {
        printf("Invaild input\n");
        return 0;
    }
    if (i < n-1)
    nodes[i].next = NULL;
    else 
       nodes[i].next = NULL;
}
struct Node *ptr =&nodes[0];
while(ptr != NULL){
    pritnf("%s",ptr->name);
    if (ptr->next !=NULL)printf(" ");
    ptr = ptr->next;
}
printf("\n");
return 0;
}