#C12327. Difference and Sorted Unique Elements

    ID: 41742 Type: Default 1000ms 256MiB

Difference and Sorted Unique Elements

Difference and Sorted Unique Elements

You are given two lists of integers. Your task is to output a sorted list of distinct integers that are found in the first list but not in the second list.

Note: Each list may contain duplicate values. The resulting list must include each eligible number only once and in ascending order.

Example:

Input:
5 1 3 2 4 4 1
2 4 6

Output: 1 3 5

</p>

If one of the lists is empty, treat it accordingly. Read the input from standard input and print the result to standard output.

inputFormat

The input consists of two lines read from standard input:

  • The first line contains space-separated integers representing the first list.
  • The second line contains space-separated integers representing the second list.

If a line is empty, it represents an empty list.

outputFormat

Output a single line containing the sorted result with distinct integers that are present in the first list but not in the second list. The integers should be separated by a single space. If no such number exists, output an empty line.

## sample
5 1 3 2 4 4 1
2 4 6
1 3 5