#include <bits/stdc++.h>
using namespace std;
const long long nax = 505;
struct info {
  char c;
  long long x, y;
};
long long n, m;
long long vis[nax][nax];
char a[nax][nax];
long long baris[] = {1, -1, 0, 0}, kolom[] = {0, 0, 1, -1};
vector<info> ans;
void dfs(long long x, long long y, long long cek) {
  ans.push_back({'B', x, y});
  vis[x][y] = 1;
  for (long long i = 0; i < 4; i++) {
    long long nx = x + baris[i];
    long long ny = y + kolom[i];
    if (nx >= 1 && nx <= n && ny >= 1 && ny <= m && a[nx][ny] == '.' &&
        !vis[nx][ny]) {
      dfs(nx, ny, cek + 1);
    }
  }
  if (cek) {
    ans.push_back({'D', x, y});
    ans.push_back({'R', x, y});
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (!vis[i][j] && a[i][j] == '.') {
        dfs(i, j, 0);
      }
    }
  }
  cout << ans.size() << '\n';
  for (auto it : ans) {
    cout << it.c << " " << it.x << " " << it.y << '\n';
  }
}
