/* ACM ICPC Southeast Regional Contest 2009 Minesweeper Author: Yiu Yu Ho */ import java.io.*; import java.util.*; public class minesweeperYiu { public Scanner in = new Scanner(System.in); public PrintStream out = System.out; public char[][] T; public int rn, cn; //8 directions public int[] dx = {-1,-1,-1, 0, 0, 1, 1, 1}; public int[] dy = {-1, 0, 1,-1, 1,-1, 0, 1}; public void main() { int i, j, k, cnt; int x, y; rn = in.nextInt(); while(rn > 0) { cn = in.nextInt(); //Read in grid T = new char[rn][]; for(i=0;i