#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double EPS = 1e-6;
char mapp[505][505];
bool visit[505][505];
struct data {
  char ope;
  pair<int, int> p;
  data() {}
  data(char ope, pair<int, int> p) : ope(ope), p(p) {}
};
enum { RED = 'R', BLUE = 'B', DESTROY = 'D' };
int m, n;
vector<data> V;
void DFS(pair<int, int> s) {
  stack<pair<int, int> > S;
  S.push(s);
  V.push_back(data(BLUE, s));
  visit[s.first][s.second] = true;
  const int OFF_X[] = {1, 0, -1, 0};
  const int OFF_Y[] = {0, 1, 0, -1};
  while (!S.empty()) {
    pair<int, int> p = S.top();
    bool found = false;
    for (int k = 0; k < 4; k++) {
      pair<int, int> next = make_pair(p.first + OFF_X[k], p.second + OFF_Y[k]);
      if (next.first >= 0 && next.first < m && next.second >= 0 &&
          next.second < n)
        if (mapp[next.first][next.second] == '.' &&
            !visit[next.first][next.second]) {
          visit[next.first][next.second] = true;
          S.push(next);
          V.push_back(data(BLUE, next));
          found = true;
          break;
        }
    }
    if (!found) {
      if (p != s) {
        V.push_back(data(DESTROY, p));
        V.push_back(data(RED, p));
      }
      S.pop();
    }
  }
}
int main() {
  scanf("%d %d", &m, &n);
  for (int r = 0; r < m; r++) scanf("%s", mapp[r]);
  for (int r = 0; r < m; r++)
    for (int c = 0; c < n; c++) {
      if (mapp[r][c] == '.' && !visit[r][c]) DFS(make_pair(r, c));
    }
  printf("%d\n", ((int)(V).size()));
  for (__typeof((V).begin()) itr = (V).begin(); itr != (V).end(); itr++)
    printf("%c %d %d\n", itr->ope, itr->p.first + 1, itr->p.second + 1);
  return 0;
}
