#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
typedef struct Node {
    char massage[101];
    struct Node* next;
} Node;
Node* createNode(char* msg) {
    Node* newNode =(Node*)malloc(sizeof(Node));
    strcpy(newNode->message, msg);
    newNode->next = NULL;
    return newNode;
}
int containsDigit(char* str) {
    for(int i= 0; str[i]; i++) {
        if(isdigit((unsigned char)str[i])) {
            return 1;
        }
    }
    return 0;
}
int main() {
    int n;
    if (scanf("%d",&n)!=1||n<1||n>1000) {
        printf("Invaild inpuyt\n");
        return 0;
    }
    Node *head = NULL, *tail = NULL;
    char msg[101];
    for(int i = 0; i < n; i++) {
        if(scanf("%s",msg)!=1) {
            printf("Invalid input\n");
            return 0;
        }
        if(containsDigit(msg)) {
            printf("Invalid input\n");
            return 0;
        }
        Node* newNode = createNode(msg);
        if (head == NULL) {
            head = tail = newNode;
        } else {
            tail->next = newNode;
            tail = newNode;
        }
    }
    Node* curr = head;
    while (curr != NULL) {
        printf("%s\n",curr-> message);
        curr = curr->next;
    }
    return 0;
}