#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
char V[1005][1005];
vector<char> c;
vector<int> x, y;
char B[1005][1005];
int n, m;
void dfs(int i, int j, int p) {
  if (V[i][j]) return;
  V[i][j] = 1;
  c.push_back('B');
  x.push_back(i + 1);
  y.push_back(j + 1);
  for (int u = int(0); u < int(4); u++) {
    int nx = i + dx[u];
    int ny = j + dy[u];
    if ((nx >= 0) && (nx < n) && (ny >= 0) && (ny < m) && (B[nx][ny] == '.')) {
      dfs(nx, ny, 1);
    }
  }
  if (p) {
    c.push_back('D');
    x.push_back(i + 1);
    y.push_back(j + 1);
    c.push_back('R');
    x.push_back(i + 1);
    y.push_back(j + 1);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < int(n); i++) {
    for (int j = 0; j < int(m); j++) {
      cin >> B[i][j];
    }
  }
  for (int i = 0; i < int(n); i++) {
    for (int j = 0; j < int(m); j++) {
      if ((!V[i][j]) && (B[i][j] == '.')) {
        dfs(i, j, 0);
      }
    }
  }
  cout << c.size() << endl;
  ;
  for (int i = 0; i < int(c.size()); i++) {
    cout << c[i] << " " << x[i] << " " << y[i] << endl;
  }
  return 0;
}
