A positive integer which is equal to C^n, where С = 1..9 contains at least K numbers C. For given numbers C and K find the smallest value of N.
In the input file contains two numbers С and K, K ≤ 500.
One number N.