#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

typedef struct Node {
    char title[101];
    struct Node* next;

int isValid(char* str) {
    for (int i = 0; str[i]; i++) {
        if (!isalpha(str[i])) return 0;
    }
    return 1;
}


int startsWith(char* str, char* prefix) {
    int len = strlen(prefix);
    return strncmp(str, prefix, len) == 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;

    for (int i = 0; i < n; i++) {
        char song[101];
        if (scanf("%s", song) != 1 || !isValid(song)) {
            printf("Invalid input\n");
            return 0;
        }

        Node* newNode = (Node*)malloc(sizeof(Node));
        strcpy(newNode->title, song);
        newNode->next = NULL;
        newNode->prev = tail;

        if (tail) tail->next = newNode;
        tail = newNode;
        if (!head) head = newNode;
    }

    char prefix[101];
    if (scanf("%s", prefix) != 1 || !isValid(prefix)) {
        printf("Invalid input\n");
        return 0;
    }

    
    int found = 0;
    Node* curr = head;
    while (curr) {
        if (startsWith(curr->title, prefix)) {
            printf("%s\n", curr->title);
            found = 1;
        }
        curr = curr->next;
    }

    if (!found) printf("No song found\n");

    return 0;
}