Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8820

Jo'natishlar soni: 714406

Muhokama yozuvlari: 4541

Yangiliklar soni: 97

Yangiliklar izohlari: 1174


So'ngi izohlar

736. Boxes
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

 There are two boxes. There are a balls in the first box, and b balls in the second box (0 < a + b <2147483648). It is possible to move balls from one box to another. From one box into another one should move as many balls as the other box already contains. You have to determine, whether it is possible to move all balls into one box.

Input

   Contains two integers a and b, delimited by space.

Output

   Print the number of moves which are required to move all balls into one box, or -1 if it is impossible.

Samples

Input

Output

1

2 6

2

2

8 12

-1

3

7 9

4

 

Tayyorladi: Azat Yusupov
Text from: acm.sgu.ru
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(57) Barcha urinishlar(185)