#include <bits/stdc++.h>
using namespace std;
void read(int& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const int N = 510;
const int K = 1000010;
const int f1[] = {0, 0, 1, -1};
const int f2[] = {1, -1, 0, 0};
int n, m, i, j, k, l, p, t;
char a[N][N];
bool v[N][N];
int path[N * N][2], tot;
int z[N][N];
int cao, ca[K][3], q[N][N];
void dfs(int x, int y, int lx, int ly) {
  int t;
  a[x][y] = '#';
  cao++, ca[cao][0] = 1, ca[cao][1] = x, ca[cao][2] = y;
  for (t = 0; t <= 3; t++)
    if (a[x + f1[t]][y + f2[t]] == '.') dfs(x + f1[t], y + f2[t], x, y);
  if (lx > 0) {
    cao++, ca[cao][0] = 0, ca[cao][1] = x, ca[cao][2] = y;
    cao++, ca[cao][0] = 2, ca[cao][1] = x, ca[cao][2] = y;
  }
}
int xx, yy, zz, oo[N][N];
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (a[i][j] == '.') {
        tot = 0;
        dfs(i, j, 0, 0);
      }
  printf("%d\n", cao);
  for (i = 1; i <= cao; i++) {
    if (ca[i][0] == 0)
      printf("D ");
    else if (ca[i][0] == 1)
      printf("B ");
    else if (ca[i][0] == 2)
      printf("R ");
    printf("%d %d\n", ca[i][1], ca[i][2]);
    xx = ca[i][0];
    yy = ca[i][1];
    zz = ca[i][2];
    if (xx == 0) {
      if (oo[yy][zz] == 0) printf("no!\n");
      oo[yy][zz] = xx;
    } else {
      if (oo[yy][zz]) printf("no!\n");
      oo[yy][zz] = xx;
    }
  }
  scanf("\n");
  return 0;
}
