#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-8;
const double PI = acos(-1);
char a[500][500];
int visited[500][500];
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, 1, 0, -1};
int h, w;
struct P {
  char c;
  int y, x;
  P(char c, int y, int x) : c(c), y(y), x(x) {}
};
vector<P> ans;
void solve(int y, int x) {
  visited[y][x] = 1;
  ans.push_back(P('B', y, x));
  a[y][x] = 'B';
  for (int i = 0; i < (int)4; ++i) {
    int yy = y + dy[i];
    int xx = x + dx[i];
    if ((0 <= yy && yy < h && 0 <= xx && xx < w) && !visited[yy][xx] &&
        a[yy][xx] == '.') {
      solve(yy, xx);
    }
  }
  ans.push_back(P('D', y, x));
  a[y][x] = '.';
  bool ok = 0;
  for (int i = 0; i < (int)4; ++i) {
    int yy = y + dy[i];
    int xx = x + dx[i];
    if ((0 <= yy && yy < h && 0 <= xx && xx < w) && a[yy][xx] == 'B') ok = 1;
  }
  if (ok) {
    ans.push_back(P('R', y, x));
    a[y][x] = 'R';
  } else {
    ans.push_back(P('B', y, x));
    a[y][x] = 'B';
  }
}
int main() {
  while (cin >> h >> w) {
    for (int i = 0; i < (int)h; ++i)
      for (int j = 0; j < (int)w; ++j) cin >> a[i][j];
    memset(visited, 0, sizeof(visited));
    ans.clear();
    for (int i = 0; i < (int)h; ++i)
      for (int j = 0; j < (int)w; ++j)
        if (!visited[i][j] && a[i][j] == '.') solve(i, j);
    cout << ans.size() << endl;
    for (__typeof((ans).begin()) it = (ans).begin(); it != (ans).end(); ++it) {
      printf("%c %d %d\n", it->c, it->y + 1, it->x + 1);
    }
  }
}
