#include <bits/stdc++.h>
using namespace std;
int n, m, len = 0;
char buf[510 * 510 * 3][10];
char g[510][510];
int used[510][510];
int d[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
void dfs(int i, int j, int f) {
  int x, y;
  used[i][j] = 1;
  sprintf(buf[len++], "B %d %d", i + 1, j + 1);
  for (int l = 0; l < 4; l++) {
    x = i + d[l][0];
    y = j + d[l][1];
    if (x >= 0 && x < n && y >= 0 && y < m && used[x][y] == 0) dfs(x, y, 0);
  }
  if (f == 0) {
    sprintf(buf[len++], "D %d %d", i + 1, j + 1);
    sprintf(buf[len++], "R %d %d", i + 1, j + 1);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> g[i][j];
      if (g[i][j] == '.')
        used[i][j] = 0;
      else
        used[i][j] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (used[i][j] == 0) dfs(i, j, 1);
    }
  }
  cout << len << endl;
  for (int i = 0; i < len; i++) puts(buf[i]);
  return 0;
}
