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 n written on the bar. At that moment a fairy appeared and spoke.
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 a femtograms in total, and the pieces in Kangsan's bag weighed exactly b femtograms in total.
Find the smallest number of days that has to pass after they enter the cave before they can leave it.
The first line contains the number of test cases t (1≤t≤1000).
Each of the next t lines contains three integers n, a, b (1≤n≤62, a,b≥1, a+b=2n).
For each test case, print on one line how many days passed when Kangsan and Jihyun left the cave as early as possible.