E. Equal Digits
time limit per test
2 seconds
memory limit per test
256 megabytes
input
stdin
output
stdout

For the given integer N and digit D, find the minimal integer K ≥ 2 such that the representation of N in the positional numeral system with base K contains the maximum possible consecutive number of digits D at the end.

Input

The input contains two integers N and D (0 ≤ N ≤ 1015, 0 ≤ D ≤ 9).

Output

Output two integers: K, the answer to the problem, and R, the the number of consecutive digits D at the end of the representation of N in the positional numeral system with base K.

Examples
Input
3 1
Output
2 2
Input
29 9
Output
10 1
Input
0 4
Output
2 0
Input
90 1
Output
89 2