#include <bits/stdc++.h>
using namespace std;
int n, m;
char x[510][510];
struct sp {
  char tip;
  int l, c;
};
vector<sp> sol;
const int lin[4] = {-1, 0, 1, 0};
const int col[4] = {0, 1, 0, -1};
sp B(int l, int c) {
  sp a;
  a.tip = 'B';
  x[l][c] = 'B';
  a.l = l;
  a.c = c;
  return a;
}
sp R(int l, int c) {
  sp a;
  a.tip = 'R';
  x[l][c] = 'R';
  a.l = l;
  a.c = c;
  return a;
}
sp D(int l, int c) {
  sp a;
  a.tip = 'D';
  x[l][c] = '.';
  a.l = l;
  a.c = c;
  return a;
}
inline bool inborder(int l, int c) {
  return (l >= 1 && l <= n) && (c >= 1 && c <= m);
}
void fill_me(int l, int c) {
  sol.push_back(B(l, c));
  for (int i = 0; i < 4; i++) {
    if (inborder(l + lin[i], c + col[i]))
      if (x[l + lin[i]][c + col[i]] == '.') {
        fill_me(l + lin[i], c + col[i]);
        sol.push_back(D(l + lin[i], c + col[i]));
        sol.push_back(R(l + lin[i], c + col[i]));
      }
  }
}
int main() {
  scanf("%d %d ", &n, &m);
  for (int i = 1; i <= n; i++) gets(x[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (x[i][j] == '.') fill_me(i, j);
  printf("%d\n", sol.size());
  for (int i = 0; i < sol.size(); i++)
    printf("%c %d %d\n", sol[i].tip, sol[i].l, sol[i].c);
  return 0;
}
