#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-ffloat-store")
#pragma GCC optimize("-fno-defer-pop")
long long int power(long long int a, long long int b, long long int m) {
  if (b == 0) return 1;
  if (b == 1) return a % m;
  long long int t = power(a, b / 2, m) % m;
  t = (t * t) % m;
  if (b & 1) t = ((t % m) * (a % m)) % m;
  return t;
}
long long int modInverse(long long int a, long long int m) {
  return power(a, m - 2, m);
}
long long int cx[4] = {0, 0, 1, -1};
long long int cy[4] = {1, -1, 0, 0};
vector<pair<long long int, long long int> > vc;
long long int n, m;
char ar[1001][1001];
bool valid(long long int i, long long int j) {
  if (i >= 0 && j >= 0 && i < n && j < m) {
    return true;
  } else
    return false;
}
long long int cnt = 0, f;
void dfs(long long int i, long long int j) {
  if (f == 1)
    f = 0;
  else
    vc.push_back({i, j});
  ar[i][j] = 'R';
  cnt += 3;
  for (long long int k = 0; k < 4; k++) {
    if (valid(i + cx[k], j + cy[k]) && ar[i + cx[k]][j + cy[k]] == '.') {
      dfs(i + cx[k], j + cy[k]);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, l;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> ar[i];
  }
  cnt = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (ar[i][j] == '.') {
        f = 1;
        cnt -= 2;
        dfs(i, j);
      }
    }
  }
  cout << cnt << "\n";
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (ar[i][j] != '#') {
        cout << "B " << i + 1 << " " << j + 1 << "\n";
      }
    }
  }
  reverse(vc.begin(), vc.end());
  for (i = 0; i < vc.size(); i++) {
    cout << "D ";
    cout << vc[i].first + 1 << " " << vc[i].second + 1 << "\n";
    cout << "R ";
    cout << vc[i].first + 1 << " " << vc[i].second + 1 << "\n";
  }
  return 0;
}
