// Arup Guha
// 7/13/06
// Solution for 2006 BHCSI Mock Contest #1 Problem Harmonic.
// Basically, this program computes the values of arbitrary
// harmonic numbers.

// Note: If we use an array, we can write this much more
//       efficiently by precomputing all 1000000 possible
//       problems in order and then looking the answers up.
//       To compute h(999999) just add 1.0/999999 to
//       h(999998), which was just previously computed. 

import java.util.*;
import java.io.*;

public class harmonic {
	
	public static void main(String[] args) throws IOException {
		
		Scanner fin = new Scanner(new File("harmonic.in"));
		
		// Read in the number of input cases.
		int numcases = fin.nextInt();
		
		// Loop through each case.
		int cnt = 1;
		while (cnt <= numcases) {
			
			// Read in which Harmonic number to calculate.
			int h = fin.nextInt();
			
			// Sum up all the necessary terms. 
			int i = 1;
			double sum = 0;
			while (i <= h) {
				sum = sum + 1.0/i; // 1.0 forces a real division.
				i = i+1;
			}
			
			// Print out the result.
			System.out.print("Case #"+cnt+": The "+h); 
			System.out.println(" Harmonic number is "+sum+".");
			
			cnt = cnt+1; // Increment the case counter.
		}
	}

}