#include <bits/stdc++.h>
using namespace std;
const int N = 1000010, D = 510;
int n, m, k, t[N];
int x[N], y[N];
bool f[D][D];
int de[3];
char s[N];
int a[D][D];
using namespace std;
void u(int ti, int i, int j) {
  t[++k] = ti;
  x[k] = i;
  y[k] = j;
}
void dfs(int i, int j);
void moze(int i, int j) {
  if (i > 0 && i <= n && j > 0 && j <= m && a[i][j] && !f[i][j]) {
    dfs(i, j);
    u(2, i, j);
    u(3, i, j);
  }
}
void dfs(int i, int j) {
  u(1, i, j);
  f[i][j] = true;
  moze(i - 1, j);
  moze(i, j - 1);
  moze(i, j + 1);
  moze(i + 1, j);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; j++)
      if (s[j] == '.') a[i][j] = 1;
  }
  de[1] = 1;
  de[2] = -1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] && !f[i][j]) dfs(i, j);
  printf("%d\n", k);
  for (int i = 1; i <= k; i++) {
    if (t[i] == 1)
      printf("B ");
    else if (t[i] == 2)
      printf("D ");
    else
      printf("R ");
    printf("%d %d\n", x[i], y[i]);
  }
  return 0;
}
