#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

// Node structure for chat message
typedef struct Node {
    char message[101]; // assuming max message length 100
    struct Node* next;
} Node;

// Function to create new node
Node* createNode(char* msg) {
    Node* newNode = (Node*)malloc(sizeof(Node));
    strcpy(newNode->message, msg);
    newNode->next = NULL;
    return newNode;
}

// Function to check if a string contains digits
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("Invalid input\n");
        return 0;
    }

    Node *head = NULL, *tail = NULL;
    char msg[101];

    for (int i = 0; i < n; i++) {
        if (scanf("%s", msg) != 1) { // read string without spaces
            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; // link old tail to new node
            tail = newNode;       // update tail
        }
    }

    // Print all chat messages in order
    Node* curr = head;
    while (curr != NULL) {
        printf("%s\n", curr->message);
        curr = curr->next;
    }

    return 0;
}