#include <stdio.h>
#includ``e <stdlib.h>
#include <string.h>
#include <ctype.h>
struct Node {
    char data[100];
    struct Node* prev;
    struct Node* next;
};
struct Node* createNode(char* value) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    strcpy(newNode->data, value);
    newNode->prev = NULL;
    newNode->next = NULL;
    return newNode;
}
void insertEnd(struct Node** head, char* value) {
    struct Node* newNode = createNode(value);
    if (*head == NULL) {
        *head = newNode;
        return;
    }
    struct Node* temp = *head;
    while (temp->next != NULL) {
        temp = temp->next;
    }
    temp->next = newNode;
    newNode->prev = temp;
}
int isValidString(char* str) {
    for (int i = 0; str[i] != '\0'; i++) {
        if (!isalpha(str[i])) return 0;
    }
    return 1;
}
void searchPrefix(struct Node* head, char* prefix) {
    struct Node* temp = head;
    int found = 0;
    int len = strlen(prefix);

    while (temp != NULL) {
        if (strncmp(temp->data, prefix, len) == 0) {
            printf("%s\n", temp->data);
            found = 1;
        }
        temp = temp->next;
    }

    if (!found) {
        printf("No song found\n");
    }
}

int main() {
    int n;
    scanf("%d", &n);

    struct Node* head = NULL;
    char song[100];
    for (int i = 0; i < n; i++) {
        scanf("%s", song);
        if (!isValidString(song)) {
            printf("Invalid input\n");
            return 0;
        }
        insertEnd(&head, song);
    }
    char prefix[100];
    scanf("%s", prefix);
    if (!isValidString(prefix)) {
        printf("Invalid input\n");
        return 0;
    }
    searchPrefix(head, prefix);

    return 0;
}