# 2175. Cow Counting

Farmer John wants to label his N (1 <= N <= 1,000,000) cows, but cows don’t like having the digit L (0 <= L <= 9) written on them, so he avoids that.

If the cows are labeled with the smallest set of N positive integers that don’t have the digit L, what is the largest number that Farmer John has to write on any cow?

### 输入格式

• Line 1: Two space-separated integers: N and L.

### 输出格式

• Line 1: A single integer that is the largest number that Farmer John has to write on any cow.

### 样例

Input
10 1

Output
22


32 人解决，51 人已尝试。

37 份提交通过，共有 109 份提交。

4.9 EMB 奖励。