#include <bits/stdc++.h>
using namespace std;
char g[502][502];
vector<char> v1;
vector<int> v2;
vector<int> v3;
int ans = 0;
void dfs(int i, int j, int ri, int rj) {
  g[i][j] = '#';
  if (g[i + 1][j] == 'B') {
    dfs(i + 1, j, ri, rj);
  }
  if (g[i - 1][j] == 'B') {
    dfs(i - 1, j, ri, rj);
  }
  if (g[i][j + 1] == 'B') {
    dfs(i, j + 1, ri, rj);
  }
  if (g[i][j - 1] == 'B') {
    dfs(i, j - 1, ri, rj);
  }
  if (i != ri || j != rj) {
    v1.push_back('D');
    v2.push_back(i);
    v3.push_back(j);
    v1.push_back('R');
    v2.push_back(i);
    v3.push_back(j);
    ans++;
    ans++;
  }
}
int main() {
  int n, m, i, j, temp;
  char c;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> c;
      g[i][j] = c;
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (g[i][j] == '.') {
        g[i][j] = 'B';
        v1.push_back('B');
        v2.push_back(i);
        v3.push_back(j);
        ans++;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (g[i][j] == 'B') dfs(i, j, i, j);
    }
  }
  cout << ans << endl;
  for (i = 0; i < v1.size(); i++) {
    cout << v1[i] << " " << v2[i] << " " << v3[i] << endl;
  }
  return 0;
}
