Consider the natural numbers greater than or equal to N whose decimal representation contains the digit d1 at least c1 times and the digit d2 at least c2 times.
Write a program that finds the smallest such number.
Input
The first line contains N, d1, c1, d2, c2, separated by spaces. (1≤N<1015, 0≤d1,d2≤9, d1=d2, 0≤c1, 0≤c2, c1+c2≤15)
Output
Print the smallest number that satisfies the condition on the first line. The answer fits in a 64-bit integer.