#include <bits/stdc++.h>
using namespace std;
char a[505][505];
const int N = 1e6 + 5;
int v[N][3], nv;
void go(int lev, int x, int y) {
  if (a[x][y] == '.') {
    v[nv][0] = 'B';
    v[nv][1] = x;
    v[nv][2] = y;
    ++nv;
    a[x][y] = 'B';
    go(lev + 1, x + 1, y);
    go(lev + 1, x - 1, y);
    go(lev + 1, x, y + 1);
    go(lev + 1, x, y - 1);
    if (lev) {
      v[nv][0] = 'D';
      v[nv][1] = x;
      v[nv][2] = y;
      ++nv;
      v[nv][0] = 'R';
      v[nv][1] = x;
      v[nv][2] = y;
      ++nv;
      a[x][y] = 'R';
    }
  }
}
int main(void) {
  int m, n;
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= m; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++)
      if (a[i][j] == '.') go(0, i, j);
  printf("%d\n", nv);
  for (int i = 0; i < nv; i++) printf("%c %d %d\n", v[i][0], v[i][1], v[i][2]);
  return 0;
}
