#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int res, ok = 1;
  char ch;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') ok = -1;
  res = ch - '0';
  for (ch = getchar(); ch >= '0' && ch <= '9'; ch = getchar())
    res = res * 10 + ch - '0';
  return res * ok;
}
const int dir[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
int n, m, tot;
struct node {
  int x, y;
};
struct point {
  int x, y;
  char a;
} ans[1000005];
bool ok[505][505], a[505][505];
inline bool check(int x, int y) {
  if (x == 0 && y == 0) return true;
  return false;
}
inline void dfs(int xx, int xy, int x, int y) {
  if (ok[xx][xy]) return;
  bool tat = true;
  ok[xx][xy] = true;
  for (int i = 0; i < 4; i++)
    if (a[xx + dir[i][0]][xy + dir[i][1]] &&
        (xx + dir[i][0] != x || xy + dir[i][1] != y)) {
      if (tat) {
        tot++;
        ans[tot].a = 'B';
        ans[tot].x = xx;
        ans[tot].y = xy;
        tat = false;
      }
      dfs(xx + dir[i][0], xy + dir[i][1], xx, xy);
    }
  if (tat) {
    if (check(x, y)) {
      tot++;
      ans[tot].a = 'B';
      ans[tot].x = xx;
      ans[tot].y = xy;
    } else {
      tot++;
      ans[tot].a = 'R';
      ans[tot].x = xx;
      ans[tot].y = xy;
    }
  } else {
    if (check(x, y)) {
      return;
    } else {
      tot++;
      ans[tot].a = 'D';
      ans[tot].x = xx;
      ans[tot].y = xy;
      tot++;
      ans[tot].a = 'R';
      ans[tot].x = xx;
      ans[tot].y = xy;
    }
  }
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      char now = getchar();
      while (now != '.' && now != '#') now = getchar();
      a[i][j] = (now == '.' ? 1 : 0);
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (!ok[i][j] && a[i][j]) {
        dfs(i, j, 0, 0);
      }
  printf("%d\n", tot);
  for (int i = 1; i <= tot; i++)
    printf("%c %d %d\n", ans[i].a, ans[i].x, ans[i].y);
  return 0;
}
