Your company has a simple requirement: every document should be spell-checked before it is sent to a customer. Word-processing documents are easy to spell-check, but employees do not always run a spell-check on the email messages they send. To fix this, you will write a program that checks each outgoing email. It spell-checks every message, and if it finds any spelling errors, the message is returned to the sender for correction.
To try out your program, you use an online dictionary together with some sample emails you have collected.
The input has two parts: the dictionary and the emails.
The first line contains the number of words in the dictionary. Each of the following lines contains one dictionary word. A word has no whitespace before, after, or inside it, but it may contain apostrophes or hyphens, which count as part of the word (so bobs and bob's are different words). There are no duplicate words, and all words are lowercase.
The emails come after the dictionary. The first line of this part contains the number of emails. Each email has already been preprocessed into one word per line, with no punctuation other than apostrophes and hyphens, no whitespace, and all words in lowercase. The end of each email is marked by a line containing only -1. Every email has at least one word.
For each email, print one of the following.
If every word is in the dictionary:
Email X is spelled correctly.
Otherwise:
Email X is not spelled correctly.
followed by every unknown word, one per line, in the order they appear in the email. If an unknown word appears several times, print it once for each occurrence.
Here X is the email number, starting at 1 and increasing by one for each email. Do not print blank lines between emails. After the output for the last email, print a line containing End of Output.