#C184. Simple Spell Checker

    ID: 45089 Type: Default 1000ms 256MiB

Simple Spell Checker

Simple Spell Checker

You are given a dictionary of correctly spelled words and a list of words from a document. Your task is to implement a spell checker that finds all words in the document that are not present in the dictionary.

More formally, let \(D\) be the set of words in the dictionary and \(L\) be the list of words in the document. Your goal is to output a list of words \(w \in L\) such that \(w \notin D\).

If no misspelled words are found, simply output an empty line.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • An integer n on the first line representing the number of words in the dictionary.
  • A line containing n space-separated words (the dictionary).
  • An integer m on the next line representing the number of words in the document.
  • A line containing m space-separated words (the document).

outputFormat

Output the misspelled words (i.e. words not found in the dictionary) on a single line, separated by a space. If there are no misspelled words, output an empty line.

## sample
4
python java kotlin javascript
4
pythons javas kotlinian javascripted
pythons javas kotlinian javascripted

</p>