#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const long double eps = 1e-9;
const int MAXN = 1000;
int a[MAXN][MAXN];
bool u[MAXN][MAXN];
vector<pair<int, int> > b, r;
int n, m;
int dx[] = {-1, 0, 0, 1};
int dy[] = {0, -1, 1, 0};
void dfs(int x, int y, bool st = true) {
  u[x][y] = true;
  for (long long t = 0; t < 4; ++t) {
    int xx = x + dx[t];
    int yy = y + dy[t];
    if (a[xx][yy] == 1 && !u[xx][yy]) dfs(xx, yy, false);
  }
  if (!st) r.push_back(pair<int, int>(x, y));
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    string s;
    cin >> s;
    for (int j = 1; j <= m; ++j)
      if (s[j - 1] == '.') {
        a[i][j] = 1;
        b.push_back(pair<int, int>(i, j));
      }
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (a[i][j] && !u[i][j]) dfs(i, j);
  cout << b.size() + r.size() * 2 << endl;
  for (long long i = 0; i < b.size(); ++i)
    printf("B %d %d\n", b[i].first, b[i].second);
  for (long long i = 0; i < r.size(); ++i) {
    printf("D %d %d\n", r[i].first, r[i].second);
    printf("R %d %d\n", r[i].first, r[i].second);
  }
}
