Narcos and Rhaegal have now quit everything else, and are resolved to complete as many TV series as possible.
Narcos claimed that he watched more number of TV series than Rheagal.
Rhaegal claimed the same.
However, Narcos was expert magician, and can convert one number A to other number B.
However, Narcos can only apply moves of the following types -
You are provided 2 integers A and B - denoting the number of TV series watched by Narcos and Rhaegal respectively.
You need to find the minimum number of moves required to convert A to B.
Input
First line of input comprises an integer T- the number of test cases.
T lines follow.
Each of those T lines have two integers - A and B.
Output
Print T lines, with each line comprising the minimum number of moves to convert value A to B.
However, if the conversion is impossible, print -1.
Constraints
1<=T<=10000
1<=A,B<=1018
Setter- Shivam Garg
First test case requires no operation to perform as both X and Y values are same.
Second test case requires 2 operations.
2 -> 4 -> 8.