You are given two sets of non-zero digits.
In decimal notation, we call a positive integer beautiful if it contains at least one digit from each of these sets.
Find the smallest beautiful number.
The first line contains two integers and - the sizes of the first and second sets. The second line contains distinct digits . The third line contains distinct digits .
Print the smallest beautiful number.
In the example, there are such beautiful numbers as , , and so on. The smallest of them is .