// Arup Guha
// 2/8/2013
// Solution to 2013 HS Online Problem: Lava

import java.util.*;

public class lava {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int loop=1; loop<=numCases; loop++) {

			int r = stdin.nextInt();
			int c = stdin.nextInt();
			char[][] grid = new char[r][c];

			// Read in grid.
			for (int i=0; i<r; i++) {
				String temp = stdin.next();
				for (int j=0; j<temp.length(); j++)
					grid[i][j] = temp.charAt(j);
			}

			// Output the result.
			int numToilets = solve(grid);
			if (numToilets >= 0)
				System.out.println("Floor #"+loop+": Only need to flush "+numToilets+" toilet(s).");
			else
				System.out.println("Floor #"+loop+": Call a plumber!");
		}
	}

	public static int solve(char[][] grid) {

		int cnt = 0;

		// Go through each square.
		for (int i=0; i<grid.length; i++) {
			for (int j=0; j<grid[i].length; j++) {

				// Fill this area.
				if (grid[i][j] == 'T') {
					fill(grid, i, j);
					cnt++;
				}
			}
		}

		// See if there is any unfilled area.
		for (int i=0; i<grid.length; i++)
			for (int j=0; j<grid[i].length; j++)
				if (grid[i][j] == '~')
					cnt = -1;

		return cnt;

	}

	// Executes a standard floodfill at (x,y).
	public static void fill(char[][] grid, int x, int y) {

		// Mark this square.
		grid[x][y] = '#';

		// Recursively mark everything else around.
		for (int dx=-1; dx<=1; dx++)
			for (int dy=-1; dy<=1; dy++)
				if (inbounds(x+dx,y+dy, grid.length, grid[0].length) && (dx == 0 || dy == 0))
					if (grid[x+dx][y+dy] == '~' || grid[x+dx][y+dy] == 'T')
						fill(grid, x+dx, y+dy);
	}

	public static boolean inbounds(int tryx, int tryy, int maxx, int maxy) {
		return tryx >= 0 && tryx < maxx && tryy >= 0 && tryy < maxy;
	}
}