You are given two integer arrays. Compute their multiset intersection: a value that appears x times in the first array and y times in the second array appears min(x, y) times in the result. Print all resulting values in ascending order (repeats included).
If the intersection is empty, print an empty line.
Input format
Line 1: an integer n, the size of the first array.
Line 2: n space-separated integers, the first array.
Line 3: an integer m, the size of the second array.
Line 4: m space-separated integers, the second array.
Output format
One line: the multiset intersection in ascending order, space-separated. If empty, print an empty line.
Constraints
- 1 <= n, m <= 100000
- -1000000000 <= each value <= 1000000000