#C12677. Unique Elements Finder

    ID: 42130 Type: Default 1000ms 256MiB

Unique Elements Finder

Unique Elements Finder

You are given two lists of integers. Your task is to find all the elements that are unique to each list, i.e. the elements that appear in one list and not in the other. Formally, if the first list represents the set \(A\) and the second list represents the set \(B\), you need to compute the sorted list corresponding to \( (A \setminus B) \cup (B \setminus A) \).

Note that duplicate values in each list should be treated as a single element, and the final result must be sorted in ascending order.

inputFormat

The input consists of two lines:

  • The first line contains the integers of the first list separated by spaces.
  • The second line contains the integers of the second list separated by spaces.

An empty line represents an empty list.

outputFormat

Print a single line containing the sorted unique elements separated by a space. If there are no unique elements, output an empty line.## sample