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 n and m (1≤n,m≤9) - the sizes of the first and second sets. The second line contains n distinct digits d1,d2,...,dn. The third line contains m distinct digits r1,r2,...,rm (1≤di,ri≤9).
Print the smallest beautiful number.
In the example, there are such beautiful numbers as 13, 18, 3451 and so on. The smallest of them is 13.