시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 512 MB125541.667%

문제

You are given a number $N$ and a digit $d$. Consider all numbers which do not contain digit $d$ in their decimal notation. Find the minimum such number for which the sum of its digits is exactly $N$.

입력

The first line contains two integers $N$ and $d$ ($2 \le N \le 10^{6}$, $0 \le d \le 9$).

출력

Print one integer: the minimum number which does not contain digit $d$ and has the sum of its digits equal to $N$.

예제 입력 1

14 9

예제 출력 1

68