This is a classic mathematics problem: using digits , arithmetic operations, and parentheses, how can you write the number ?
For example, this can be achieved as (2 + 2 \times 2) + 2 / 2, or 22 / 2 - 2 \times 2, or 2 \times (2 + 2) - 2 / 2.
Given exactly digits , what is the smallest natural number that cannot be represented using arithmetic expressions formed from these digits (you may use arithmetic operations and parentheses)?
The only line contains two natural numbers and (1 \leq n \leq 7, 1 \leq d \leq 9).
Print the smallest natural number that cannot be written as an arithmetic expression using exactly digits .
Example 1
Division must always be integer division (without remainder).