#include <stdio.h>
#include <string.h>
#include <ctype.h> // For isalnum

// Function to check if a string contains only alphabets
int isValidInput(const char *str) {
    for (int i = 0; str[i] != '\0'; i++) {
        if (!isalpha(str[i])) { // Check if character is not an alphabet
            return 0; // Invalid input found
        }
    }
    return 1; // All characters are alphabets
}
int main() {
    int n;
    scanf("%d", &n);

    if (n < 1 || n > 1000) {
        printf("Invalid input\n"); // Constraint violation
        return 1;
    }

    char songs[101]; // Assuming max song title length of 100
    for (int i = 0; i < n; i++) {
        scanf("%s", songs[i]);
        if (!isValidInput(songs[i])) {
            printf("Invalid input\n");
            return 1;
        }
    }

    char prefix[101]; // Assuming max prefix length of 100
    scanf("%s", prefix);
    if (!isValidInput(prefix)) {
        printf("Invalid input\n");
        return 1;
    }
    int found = 0;
    for (int i = 0; i < n; i++) {
        // Compare the beginning of the song title with the prefix
        if (strncmp(songs[i], prefix, strlen(prefix)) == 0) {
            printf("%s\n", songs[i]);
            found = 1;
        }
    }

    if (!found) {
        printf("No song found\n");
    }

    return 0;
}