He converts two integers X and Y into binary system without leading zeros, if they have the same quantity of 0 and the same quantity of 1 in the binary system, Mr.Frog will think these two integers are friendly.
For example, 5(10) = 101(2) and 6(10) = 110(2), both of them have two 1 and one 0 in the binary system, so Mr.Frog thinks 5 and 6 are friendly.
Now, Mr.frog gets an integer N and defines a sorted set S. The sorted set S consists of integers which are friendly with N and bigger than N. He wants to know what is the Kth integer in S.
Because Mr.Frog is on his way back from Hong Kong to Beijing, he wants to ask you for help.
The first line contains an integer T, where T is the number of test cases. T test cases follow.For each test case, the only line contains two integers N and K.• 1 ≤ T ≤ 200.• 1 ≤ N ≤ 1018.• 1 ≤ K ≤ 1018
For each test case, print one line containing “Case #x: y”, where x is the test case number (startingfrom 1) and y is the Kth integer in the sorted set S. If the integer he wants to know does not exist, y is“ IMPOSSIBLE”.
For the first case, the sorted set S is {10, 12}, so the 2nd integer is 12.For the second case, the sorted set S is ∅, so the answer is “IMPOSSIBLE”.