#include <bits/stdc++.h>
using namespace std;
int readint() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return flag ? -x : x;
}
stringstream ss;
int n, m, siz;
char c[555][555];
bool u[555][555];
inline void dfs(int x, int y, bool fst) {
  if (x < 0 || x == n || y < 0 || y == m) return;
  if (u[x][y] == 1) return;
  ss << "B " << x + 1 << " " << y + 1 << '\n';
  siz++;
  u[x][y] = 1;
  dfs(x, y - 1, 1);
  dfs(x - 1, y, 1);
  dfs(x + 1, y, 1);
  dfs(x, y + 1, 1);
  if (fst) {
    siz += 2;
    ss << "D " << x + 1 << " " << y + 1 << '\n';
    ss << "R " << x + 1 << " " << y + 1 << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int i, j;
  cin >> n >> m;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      cin >> c[i][j];
      if (c[i][j] == '#') u[i][j] = 1;
    }
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++)
      if (!u[i][j]) dfs(i, j, 0);
  cout << siz << endl;
  cout << ss.str();
  return 0;
}
