Given a positive integer and a set of digits , find the smallest positive integer divisible by such that its decimal representation contains only digits from , and no two consecutive digits are the same.
The first line contains the set of allowed digits, listed in ascending order, without spaces or duplicates. The set may be empty.
The second line contains a single integer (1 \leq K \leq 10^5).
Print such a number if it exists. If there is no such number, print –1.
Example 1