#C9360. Find Missing Labels
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:
- The first line contains an integer \(n\), the number of generated labels.
- The second line contains \(n\) space-separated strings representing the generated labels.
- The third line contains an integer \(m\), the number of assigned labels.
- 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.
## sample4
A1 B2 C3 D4
2
A1 D4
B2 C3