Description

Spelling Checker is a tool that helps type words correctly. When you make a typo, it prompts similar words in dictionary for you. For example, you type "computor" by mistake, Spelling Checker will remind you with the correct word "computer".
In this problem, we use edit distance to measure the similarity of two words. It is given by the minimum number of operations needed to transform one word into the other, where an operation is an insertion, deletion, or substitution of a single character. In the example above, the edit distance of "computer" and "computor" is 1, since only one operation is needed to transform 'computor' into 'computer'.
Now, you are to write a Spelling Checker to find all the words from a dictionary whose edit distance with the typo is less than 3.

Input

There's only one test case. The first line is an integer N (1 <= N <= 10000) indicating the size of dictionary. The following lines are N different words. Then the number of typed words T (1 <= T <= 100) and T lines of words are given. All the words are in lower-case and the maximum length of a word is not more than 10.

Output

For each typo, list the words found in the dictionary within edit distance of 3 in a single line. Words are sorted by alphabetic order and separated by a space character. If nothing found, output "NONE". If it's not a typo, output "CORRECT".

Sample Input

6
acme
acm
hello
world
computer
science
4
acmer
word
conbutor
science

Sample Output

acm acme
world
NONE
CORRECT

Source

6th SCUPC