#include <bits/stdc++.h>
using namespace std;
int m, n, s, ts;
char a[505][505];
bool vis[505][505];
stringstream v;
void dfs(int i, int j, bool boot = 0) {
  v << "B"
    << " " << i << " " << j << "\n";
  ++s;
  vis[i][j] = 1;
  if (a[i + 1][j] == '.' && vis[i + 1][j] == 0) dfs(i + 1, j, 1);
  if (a[i - 1][j] == '.' && vis[i - 1][j] == 0) dfs(i - 1, j, 1);
  if (a[i][j + 1] == '.' && vis[i][j + 1] == 0) dfs(i, j + 1, 1);
  if (a[i][j - 1] == '.' && vis[i][j - 1] == 0) dfs(i, j - 1, 1);
  if (boot != 0) {
    s += 2;
    v << "D"
      << " " << i << " " << j << "\n"
      << "R"
      << " " << i << " " << j << " "
      << "\n";
  }
}
int main() {
  cin >> m >> n;
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i][j] == '.' && vis[i][j] == 0) dfs(i, j);
    }
  }
  cout << s << endl;
  cout << v.str();
  return 0;
}
