import java.io.*;
import java.util.*;

public class checkers_mb {
    static final char SPACE = '.';

    static class Point implements Comparable<Point> {
        int x, y;
        Point(int xx, int yy) {
            x = xx;
            y = yy;
        }
        public int compareTo(Point that) {
            return x == that.x ? y - that.y : x - that.x;
        }
        public String toString() {
            return "(" + (x + 1) + ", " + (y + 1) + ")";
        }
    }

    static TreeSet<Point> black = new TreeSet<Point>();
    static TreeSet<Point> white = new TreeSet<Point>();

    static class Field {
        char[][] lines;

        Field(String[] input) {
            lines = new char[8][];
            for (int i = 0; i < 8; i++) {
                lines[i] = input[i].toCharArray();
            }
        }
    }

    static void go(Field f, int x, int y, char me, char him, TreeSet<Point> dest) {
        if (x > 1 && y > 1 && f.lines[x - 1][y - 1] == him && f.lines[x - 2][y - 2] == SPACE) {
            dest.add(new Point(x - 1, y - 1));
            f.lines[x - 2][y - 2] = me;
            f.lines[x - 1][y - 1] = f.lines[x][y] = SPACE;
            go(f,   x - 2, y - 2, me, him, dest);
            f.lines[x - 2][y - 2] = SPACE;
            f.lines[x - 1][y - 1] = him;
            f.lines[x][y] = me;
        }
        if (x > 1 && y < 6 && f.lines[x - 1][y + 1] == him && f.lines[x - 2][y + 2] == SPACE) {
            dest.add(new Point(x - 1, y + 1));
            f.lines[x - 2][y + 2] = me;
            f.lines[x - 1][y + 1] = f.lines[x][y] = SPACE;
            go(f,   x - 2, y + 2, me, him, dest);
            f.lines[x - 2][y + 2] = SPACE;
            f.lines[x - 1][y + 1] = him;
            f.lines[x][y] = me;
        }
        if (x < 6 && y > 1 && f.lines[x + 1][y - 1] == him && f.lines[x + 2][y - 2] == SPACE) {
            dest.add(new Point(x + 1, y - 1));
            f.lines[x + 2][y - 2] = me;
            f.lines[x + 1][y - 1] = f.lines[x][y] = SPACE;
            go(f,   x + 2, y - 2, me, him, dest);
            f.lines[x + 2][y - 2] = SPACE;
            f.lines[x + 1][y - 1] = him;
            f.lines[x][y] = me;
        }
        if (x < 6 && y < 6 && f.lines[x + 1][y + 1] == him && f.lines[x + 2][y + 2] == SPACE) {
            dest.add(new Point(x + 1, y + 1));
            f.lines[x + 2][y + 2] = me;
            f.lines[x + 1][y + 1] = f.lines[x][y] = SPACE;
            go(f,   x + 2, y + 2, me, him, dest);
            f.lines[x + 2][y + 2] = SPACE;
            f.lines[x + 1][y + 1] = him;
            f.lines[x][y] = me;
        }
    }

    static void process(Field f, char me, char him, TreeSet<Point> dest) {
        for (int i = 0; i < 8; i++) {
            for (int j = 0; j < 8; j++) {
                if (f.lines[i][j] == me) {
                    go(f, i, j, me, him, dest);
                }
            }
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("checkers.in"));
        String[] fieldIn = new String[8];
        for (int i = 0; i < 8; i++) {
            fieldIn[i] = br.readLine();
        } 
        br.close();

        int wCount = 0, bCount = 0;
        for (int i = 0; i < 8; i++) {
            assert fieldIn[i].length() == 8;
            for (int j = 0; j < 8; j++) {
                switch (fieldIn[i].charAt(j)) {
                case 'B':
                    bCount++;
                    break;
                case 'W':
                    wCount++;
                    break;
                case '.':
                    break;
                default:
                    assert false;
                }
            }            
        }

        assert wCount <= 12 && bCount <= 12;

        Field field = new Field(fieldIn);

        process(field, 'W', 'B', white);
        process(field, 'B', 'W', black);

        PrintWriter out = new PrintWriter("checkers.out");
        out.println("White: " + white.size());
        for (Iterator<Point> i = white.iterator(); i.hasNext(); ) {
            out.print(i.next());
            out.print(i.hasNext() ? ", " : "\n");
        }
        out.println("Black: " + black.size());
        for (Iterator<Point> i = black.iterator(); i.hasNext(); ) {
            out.print(i.next());
            out.print(i.hasNext() ? ", " : "\n");
        }
        out.close();
    }
}