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