public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		StringBuilder out = new StringBuilder();
		int nCase = 1;
		while ((line = in.readLine()) != null && line.length() != 0) {
			size = Integer.parseInt(line.trim());
			if (size == 0)
				break;
			map = new char[size][size];
			used = new boolean[size][size];
			for (int i = 0; i < size; i++)
				map[i] = in.readLine().trim().toCharArray();
			winWhite = false;
			for (int i = 0; i < size && !winWhite; i++)
				if (map[i][0] == 'w') 
					floodFill(i, 0);
			out.append(nCase++ + " ");
			out.append((winWhite ? "W" : "B") + "\n");
		}
		System.out.print(out);
	}