#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:667772160")
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int dx[] = {0, 0, 1, -1};
int dy[] = {-1, 1, 0, 0};
char str[507][507];
int n, m;
int num_of_blue(int x, int y) {
  if (str[x][y] != 'B') return 0;
  int tx, ty, cont = 0;
  for (int i = 0; i < 4; i++) {
    tx = x + dx[i];
    ty = y + dy[i];
    if (tx >= 0 && tx < n && ty >= 0 && ty < m && str[tx][ty] == 'B') cont++;
  }
  return cont;
}
int gx, gy;
vector<pair<int, int> > fans;
vector<int> type;
void dfs(int x, int y) {
  fans.push_back(make_pair(x, y));
  type.push_back(0);
  str[x][y] = 'B';
  int tx, ty;
  for (int i = 0; i < 4; i++) {
    tx = x + dx[i];
    ty = y + dy[i];
    if (tx >= 0 && tx < n && ty >= 0 && ty < m && str[tx][ty] == '.')
      dfs(tx, ty);
  }
  if (x == gx && y == gy) return;
  fans.push_back(make_pair(x, y));
  fans.push_back(make_pair(x, y));
  type.push_back(1);
  type.push_back(2);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", str[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (str[i][j] == '.') {
        gx = i;
        gy = j;
        dfs(i, j);
      }
    }
  }
  int siz = fans.size();
  printf("%d\n", siz);
  for (int i = 0; i < siz; i++) {
    if (type[i] == 0)
      printf("B ");
    else if (type[i] == 1)
      printf("D ");
    else
      printf("R ");
    printf("%d %d\n", fans[i].first + 1, fans[i].second + 1);
  }
  return 0;
}
