// Arup Guha
// 12/15/2016
// Solution to 2016 Online HS Problem: Johnny's Shapes

import java.util.*;

public class shapes {

	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++) {

			// Read in number of sides.
			int n = stdin.nextInt();

			// Output result.
			if (n <= 4)
				System.out.println("Shape #"+loop+": Johnny's favorite!");
			else
				System.out.println("Shape #"+loop+": Johnny will not be pleased with this one.");
		}
	}
}