Given two numbers **M** and **N**. The task is to find the position of **rightmost different** bit in binary representation of numbers.

**Input:**

The input line contains T, denoting the number of testcases. Each testcase follows. First line of each testcase contains two space separated integers M and N.

**Output:**

For each testcase in new line, print the position of rightmost different bit in binary representation of numbers. If both M and N are same then print **-1** in this case.

**Constraints:**

1 <= T <= 100

1 <= M <= 10^{3}

1 <= N <= 10^{3}

**Example:**

**Input:**

2

11 9

52 4

**Output:**

2

5

**Explanation:
Tescase 1: **Binary representaion of the given numbers are: 1011 and 1001, 2nd bit from right is different.

Author: harsh.agarwal0

lakshmi_pandey | 72 |

abbatta7 | 68 |

Ashish Kumar Vaishy | 62 |

aman19 | 58 |

Kumar Gaurav Singh | 58 |

saumitra13325 | 612 |

ashujack | 551 |

lakshmi_pandey | 544 |

aman19 | 538 |

piyushmittal25 | 514 |

blackshadows | 5249 |

akhayrutdinov | 5111 |

Ibrahim Nash | 5087 |

Quandray | 4354 |

sanjay05 | 3668 |

Login to report an issue on this page.