Digits
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
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.
Input
In the input file contains two numbers С and K, K ≤ 500.
Output
One number N.
Examples
Input #1
Answer #1
Submissions 610
Acceptance rate 20%