#include <bits/stdc++.h>
using namespace std;
int n, m, dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1};
char a[505][505];
bool b[505][505], ret = false;
stringstream ss;
int k = 0;
void dfs(int x, int y, bool g) {
  ret = false;
  if (!b[x][y]) {
    if (!g) {
      ss << "D " << x + 1 << " " << y + 1 << "\n"
         << "R " << x + 1 << " " << y + 1 << "\n";
      k++;
      k++;
    }
    return;
  } else {
    b[x][y] = false;
    for (int i = 0; i < 4; i++) {
      if (a[x + dx[i]][y + dy[i]] == '.' && b[x + dx[i]][y + dy[i]]) {
        ret = true;
        dfs(x + dx[i], y + dy[i], false);
      }
    }
    if (!g && !ret) {
      ss << "D " << x + 1 << " " << y + 1 << "\n"
         << "R " << x + 1 << " " << y + 1 << "\n";
      k++;
      k++;
    }
    return;
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
      b[i][j] = true;
      if (a[i][j] == '.') {
        k++;
        ss << "B " << i + 1 << " " << j + 1 << "\n";
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] == '.' && b[i][j]) {
        dfs(i, j, true);
      }
    }
  }
  cout << k << "\n" << ss.str();
  return 0;
}
