#include <bits/stdc++.h>
using namespace std;
vector<string> v;
int vis[1000][1000];
stringstream temp;
int sum = 0;
int n, m;
void dfs(int i, int j, int start = 0) {
  if (i < 0 || j < 0 || i == n || j == m) return;
  if (vis[i][j]) return;
  if (v[i][j] != 'B') return;
  vis[i][j] = 1;
  dfs(i - 1, j);
  dfs(i, j - 1);
  dfs(i + 1, j);
  dfs(i, j + 1);
  if (start == 0) {
    sum += 2;
    temp << "D " << i + 1 << ' ' << j + 1 << endl
         << "R " << i + 1 << ' ' << j + 1 << endl;
    v[i][j] = 'R';
  }
  return;
}
int main() {
  string s;
  while (cin >> n >> m) {
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < n; i++) {
      cin >> s;
      v.push_back(s);
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (v[i][j] == '.') {
          temp << "B " << i + 1 << ' ' << j + 1 << endl;
          sum++;
          v[i][j] = 'B';
        }
      }
    }
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) {
        dfs(i, j, 1);
      }
    cout << sum << endl;
    cout << temp.str();
  }
}
