Two sensors each emit a singly linked list of readings already sorted in non-decreasing order. Merge the two chains into a single chain that is also sorted in non-decreasing order, splicing existing nodes together, and report the merged values.
Because the output is the fully sorted multiset of all values, the answer is unique.
Input format
Line 1: an integer na, the length of the first list.
Line 2: na space-separated integers in non-decreasing order (empty line when na is 0).
Line 3: an integer nb, the length of the second list.
Line 4: nb space-separated integers in non-decreasing order (empty line when nb is 0).
Output format
A single line with all na + nb values in non-decreasing order, space-separated. If both lists are empty, print EMPTY.
Constraints
- 0 <= na, nb <= 100000
- Each list is given in non-decreasing order.
- -1000000000 <= each value <= 1000000000
- Values may repeat within and across the two lists.