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 (1 \le n, m \le 9) - the sizes of the first and second sets. The second line contains distinct digits d_1, d_2, \ldots, d_n. The third line contains distinct digits r_1, r_2, \ldots, r_m (1 \le d_i, r_i \le 9).
Print the smallest beautiful number.
In the example, there are such beautiful numbers as , , and so on. The smallest of them is .
Example 1