W  — Sierpinski Carpet

Time Limit: 1 sec
Memory Limit: 32 MB

The Sierpinski carpet is a typical plane fractal. The construction of it begins with a square. The square is cut into 9 congruent subsquares in a 3-by-3 grid, and the central subsquare is removed. The same procedure is then applied recursively to the remaining 8 subsquares, ad infinitum.

Let’s call the first figure (single square) from which we begin carpet construction S0, next figure (combined 8 squares) S1, S2 figure is combined of 64 squares and so on.

Here is an example of full Sierpinski carpet (S):

In this problem you will be given a point in the plain and you have to find the maximal figure SN to which this point still belongs.

INPUT

The number of tests T (T ≤ 100) is given on the first line. Each of next T lines contains two floating point numbers cordinates X (0 < X < 1) and Y (0 < Y < 1) of a given point. Point’s cordinates are given with maximal precision of 6 digits after decimal point.

OUTPUT

For each test case output a single line "Case T: N". Where T is the test case number (starting from 1) and N is the maximal index of figure S that point still belongs to. If point is in Sierpinski Carpet itself (S) then N must be equal to -1.

SAMPLE INPUT

2
0.111 0.111
0.123 0.123

SAMPLE OUTPUT

Case 1: 10
Case 2: 1

Problem by: Aleksej Viktorchik; Leonid Sislo
Huge Easy Contest #2