Gold Rush

No attempts yetTime limit1sMemory limit256 MB

Problem

Kangsan and Jihyun were on an adventure when they found a mysterious cave deep in the forest. They walked in full of excitement, and at the very end of the cave they found one huge gold bar. The bar was far too big and heavy for the two of them to carry out.

While they were wondering what to do, Jihyun noticed the number nn written on the bar. At that moment a fairy appeared and spoke.

  • Fairy: This bar is heavy. It weighs a whole 2n2^n femtograms. And nn goes as high as 62.
  • Kangsan: Oh, then we are in luck! Jihyun's bag holds exactly aa femtograms and my bag holds exactly bb femtograms, and a+b=2na + b = 2^n.
  • Jihyun: But how do we cut the bar?
  • Fairy: My magic can split any object into two exactly equal halves. The problem is that I can use it only once a day.

Once a day the fairy picks one of the pieces produced so far and cuts it into two equal halves. Some days later Kangsan and Jihyun divided every piece between their bags and left the cave. The pieces in Jihyun's bag weighed exactly aa femtograms in total, and the pieces in Kangsan's bag weighed exactly bb femtograms in total.

Find the smallest number of days that has to pass after they enter the cave before they can leave it.

Input

The first line contains the number of test cases tt (1t10001 \le t \le 1000).

Each of the next tt lines contains three integers nn, aa, bb (1n621 \le n \le 62, a,b1a, b \ge 1, a+b=2na + b = 2^n).

Output

For each test case, print on one line how many days passed when Kangsan and Jihyun left the cave as early as possible.