IntermediateRating 1100
Union of Sorted Lists
Two lists are sorted. Print all the different values that appear in either list, in increasing order.
Input
Two lines, each starting with its length.
Output
One line.
Sample 1
Input
5 1 2 3 4 5 3 1 2 3
Output
1 2 3 4 5
Sample 2
Input
3 1 1 2 2 2 9
Output
1 2 9
Output appears here