#include <stdlib.h>
#include <string.h>
#inc#include <stdio.h>
lude <ctype.h>

struct Node {
    char data[101];
    struct Node* prev;
    struct Node* next;
};

struct Node* createNode(char* data) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    if (!newNode) {
        printf("Memory allocation failed\n");
        exit(1);
    }
    strcpy(newNode->data, data);
    newNode->prev = NULL;
    newNode->next = NULL;
    return newNode;
}

void append(struct Node** head, struct Node** tail, char* data) {
    struct Node* newNode = createNode(data);
    if (*head == NULL) {
        *head = *tail = newNode;
    } else {
        newNode->prev = *tail;  // key line to link new node to tail
        (*tail)->next = newNode;
        *tail = newNode;
    }
}

int isValidSong(char* str) {
    for (int i = 0; str[i] != '\0'; i++) {
        if (!isalpha(str[i])) return 0;  // no numbers or symbols
    }
    return 1;
}

int startsWith(char* str, char* prefix) {
    int len = strlen(prefix);
    return strncmp(str, prefix, len) == 0;
}

void freeList(struct Node* head) {
    while (head) {
        struct Node* temp = head->next;
        free(head);
        head = temp;
    }
}

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;

    char buffer[101];
    for (int i = 0; i < n; i++) {
        if (scanf("%100s", buffer) != 1 || !isValidSong(buffer)) {
            printf("Invalid input\n");
            freeList(head);
            return 0;
        }
        append(&head, &tail, buffer);
    }

    if (scanf("%100s", buffer) != 1 || !isValidSong(buffer)) {
        printf("Invalid input\n");
        freeList(head);
        return 0;
    }

    int found = 0;
    struct Node* temp = head;
    while (temp) {
        if (startsWith(temp->data, buffer)) {
            printf("%s\n", temp->data);
            found = 1;
        }
        temp = temp->next;
    }

    if (!found) {
        printf("No song found\n");
    }

    freeList(head);
    return 0;
}