Boxes#1183

Boxes

1 second
128 megabytes
Very easy

There are two boxes. The first box contains balls, and the second box contains balls, where 0 < a + b < 2147483648. You can move balls from one box to the other. On each move, you may move from one box to the other exactly as many balls as the other box contains. Determine whether it is possible to gather all the balls in one box.

Input

Each line contains two integers and , separated by a space.

Output

For each test case, print on a separate line the number of moves required to gather all the balls in one box, or -1 if it is impossible.

Examples

Example 1

Loading
Loading