#Lutece0070. The Heroes

The Heroes

Migrated from Lutece 70 The Heroes

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Dr. Suresh has discovered that special genetic pieces would enable human beings to have special abilities, such as flying, self-healing, time-stopping, and so on. He would like to compile a list containing all such special people. An individual is on the list if and only if his genetic code contains one of the special pieces as a substring. Please help Dr.Suresh to do the task.

Input

The first line contains an integer NN, number of special genetic pieces. Following NN lines each contain a string, the genetic code of each piece. On the next line is an integer MM, number of individuals to be examined. Next MM lines each has a string, which is the genetic code of each individual.

  • 1N10,1M501 \leq N \leq 10, 1 \leq M \leq 50

  • The length of any genetic code is greater than zero and does not exceed 5050.

  • A genetic code is a string containing A, T, C and G only and it doesn't contain any white spaces.

  • String AA is a substring of BB, if and only if AA appears continuously in BB (e.g. ATC is a substring of AATCTC, but ATT isn't).

  • A Hero's genetic code can contain multiple kinds of special genetic pieces as substrings.

Output

For each individual, if he is on the list, output A new hero discovered on a single line. Otherwise output Just an ordinary person instead.

Samples

2
ATA
ATC
3
ACATAG
AATTCCGG
ATCGGATACG
A new hero discovered
Just an ordinary person
A new hero discovered

Resources

The 5th UESTC Programming Contest Preliminary