Write a simple spell checker. First you will read a set of words as a dictionary. Next you will read a set of word as text. For example our dictionary has
banana. All words are in lower case from
For every word in text you must look up the dictionary and determine if the spelling is correct. If the word from text is in the dictionary, like apple, then you output a line
If the word from text is not in the dictionary, you must list all possible candidates as
?apple apples, in the order they appear in the dictionary. A word in the dictionary is a candidate if one of the following is true.
If you cannot find any candidate, simply output
The first line contains an integer $N$ denoting the number of words in the dictionary. Followed by $N$ lines, each line contains a word $w_i$ denoting the $i$-th word in the dictionary. After $N+1$ lines, the next line contains an integer $Q$ denoting the number of words in text. Followed by $Q$ lines, each line contains a word $q_i$ denoting the $i$-th word in text.
5 case content contest common onganize 4 cases common context come
?case >common ?content contest !come