// Arup Guha
// 3/7/2015
// Solution to 2016 UCF HS Problem: Guessing Game

import java.util.*;

public class guessing {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=1; loop<=numCases; loop++) {

			// Get input value.
			int low = stdin.nextInt();
			int high = stdin.nextInt();
			int val = stdin.nextInt();

			// Run binary search.
			int numGuesses = 0;
			while (low <= high) {

				// This is annoying - different than how a binary search is typically taught...
				int guess = (low+high+1)/2;
				numGuesses++;

				// Great, we got it!
				if (guess == val) break;

				// Our guess is too low.
				if (guess < val) low = guess+1;

				// Our guess was too high
				if (guess > val) high = guess-1;
			}

			// Output the result to this case.
			if (numGuesses > 1)
				System.out.println("Game #"+loop+": "+numGuesses+" guesses");
			else
				System.out.println("Game #"+loop+": 1 guess");
		}
	}
}