#include <bits/stdc++.h>
using namespace std;
struct {
  int p1, p2, p3;
} b[1000100];
bool f[600][600], g[600][600];
int dx[5] = {0, 1, -1, 0, 0};
int dy[5] = {0, 0, 0, 1, -1};
int top = 0;
void dfs(int t, int i, int j) {
  if (i < 1 || j < 1) return;
  if (!f[i][j] || g[i][j]) return;
  g[i][j] = 1;
  int k;
  for (k = 1; k <= 4; k++) dfs(t + 1, i + dx[k], j + dy[k]);
  if (t) {
    b[++top].p1 = 3;
    b[top].p2 = i;
    b[top].p3 = j;
    b[++top].p1 = 2;
    b[top].p2 = i;
    b[top].p3 = j;
  }
}
char ts[10000];
int main() {
  int n, m, i, j;
  cin >> n >> m;
  gets(ts);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      char tc = getchar();
      f[i][j] = (tc == '.');
    }
    gets(ts);
  }
  top = 0;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (f[i][j]) {
        b[++top].p1 = 1;
        b[top].p2 = i;
        b[top].p3 = j;
      }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (f[i][j] && !g[i][j]) dfs(0, i, j);
  cout << top << endl;
  for (i = 1; i <= top; i++) {
    if (b[i].p1 == 1)
      cout << "B ";
    else if (b[i].p1 == 2)
      cout << "R ";
    else
      cout << "D ";
    printf("%d %d\n", b[i].p2, b[i].p3);
  }
  return 0;
}
