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.
Each line contains two integers and , separated by a space.
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.
Example 1