SP20977 UCBINTB - Car Game

Description

Traveling by car can sometimes be very boring. The natural cure for this boredom is to play a word

Input Format

The first line of input contains two positive integers (N 5000) and (M 10000), the number of words in the dictionary and the number of license plates to be handled. Each of the following N lines contains a word from the dictionary, a string no more than 100 characters long containing only lower case letters from the English alphabet. This is followed by M lines each containing a string of three uppercase letters from the English alphabet, representing a license plate.

Output Format

For each license plate in the input you should output one line containing either the first valid word in the dictionary or the sentence "No valid word" if no such word exists.