Given positive integer and the set of digits . Find the minimum integer, bigger or equal to , which decimal notation contains the digits from set only. The decimal notation of a number must not contain two consecutive identical digits.
First line contains the set of valid digits in increasing order without spaces and repetitions. Second line contains number (1 \le k \le 10^5).
Print one required number. If the number does not exist, print .
Example 1
Example 2