Transform

Time Limit: 3000ms

Memory Limit: 65535kb

Description

One can transform x into x+d if d is divisor of x. Find out the minimum number of steps to transform a into b. (d is positive)

Input

Each test case contains two integers a and b.(1≤a,b≤10^5). Ends with EOF.

Output

The only integer denotes the minimum number of steps. Print -1 if impossible.

Sample Input

1 6

Sample Output

3

Hint

1->2->4->6 or 1->2->3->6

Source

gxx

提交代码