#C9360. Find Missing Labels

    ID: 53445 Type: Default 1000ms 256MiB

Find Missing Labels

Find Missing Labels

You are given two lists of labels: a list of generated labels and a list of assigned labels. Your task is to find all labels that appear in the generated list but are missing in the assigned list, and output them in lexicographical order.

Mathematically, if we denote the set of generated labels by \(G\) and the set of assigned labels by \(A\), you are to compute the sorted list for \[ missing = \{ x \in G : x \notin A \} \]

If there are no missing labels, output an empty line.

inputFormat

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

  1. The first line contains an integer \(n\), the number of generated labels.
  2. The second line contains \(n\) space-separated strings representing the generated labels.
  3. The third line contains an integer \(m\), the number of assigned labels.
  4. The fourth line contains \(m\) space-separated strings representing the assigned labels.

outputFormat

Print the missing labels in lexicographical order on a single line, separated by spaces. If there are no missing labels, print an empty line.

## sample
4
A1 B2 C3 D4
2
A1 D4
B2 C3