#C51. Spell Checker

    ID: 48711 Type: Default 1000ms 256MiB

Spell Checker

Spell Checker

Given a dictionary and a text, identify the words in the text that are not present in the dictionary. If every word from the text is found in the dictionary, output "All words found".

Let \(D\) be the set of dictionary words and \(T\) be the list of text words. You need to compute the set \(T \setminus D\) in the order of the words in \(T\). If \(T \setminus D\) is empty, then print "All words found".

Example: For dictionary = [hello, world, python] and text = [hello, java, script, world, code], the result is [java, script, code].

inputFormat

The input is read from standard input in the following format:

  • The first line contains an integer \(M\), representing the number of words in the dictionary.
  • The second line contains \(M\) space-separated words: the dictionary words.
  • The third line contains an integer \(N\), representing the number of words in the text.
  • The fourth line contains \(N\) space-separated words: the text words to be checked.

outputFormat

If there are words in the text that are not in the dictionary, print each missing word on a new line in the same order as they appear in the text. Otherwise, print a single line with "All words found".

## sample
3
hello world python
2
hello world
All words found

</p>