LearnPy Hub
← Tuples & Sets problems
Hard

Set Operations

Read two lines of integers A and B. Print four lines: A ∪ B, A ∩ B, A − B and B − A, each sorted, separated by spaces (empty line if empty).

Input

Two lines.

Output

Four lines.

Sample 1

Input
1 2 3
3 4
Output
1 2 3 4
3
1 2
4

Sample 2

Input
1
1
Output
1
1
solution.py
Output appears here
Set Operations · Python practice problem · LearnPy Hub