#include <bits/stdc++.h>
using namespace std;
int rr[] = {0, 0, 1, -1};
int cc[] = {-1, 1, 0, 0};
struct data {
  int x, y;
  char ch;
  data() {}
  data(int x, int y, int ch) : x(x), y(y), ch(ch) {}
};
string mat[505];
int r, c;
bool vis[505][505];
vector<data> out;
bool ok(int x, int y) {
  if ((x > -1 && x < r) && (y > -1 && y < c) && mat[x][y] == '.' && !vis[x][y])
    return true;
  return false;
}
void dfs(int x, int y, bool chk) {
  vis[x][y] = true;
  out.push_back((data(x + 1, y + 1, 'B')));
  for (int i = 0; i < 4; i++) {
    int nx = x + rr[i];
    int ny = y + cc[i];
    if (ok(nx, ny)) {
      dfs(nx, ny, false);
    }
  }
  if (!chk) {
    out.push_back((data(x + 1, y + 1, 'D')));
    out.push_back((data(x + 1, y + 1, 'R')));
  }
  return;
}
int main() {
  cin >> r >> c;
  for (int i = 0; i < r; i++) cin >> mat[i];
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      if (mat[i][j] == '.' && !vis[i][j]) {
        dfs(i, j, true);
      }
    }
  }
  cout << ((long long)out.size()) << endl;
  for (int i = 0; i < ((long long)out.size()); i++)
    cout << out[i].ch << " " << out[i].x << " " << out[i].y << endl;
  return 0;
}
