#include <bits/stdc++.h>
using namespace std;
int n, m;
bool v[505][505];
pair<int, pair<int, int>> op[1000005];
int ri, rj, ind = 1;
void d(int i, int j) {
  v[i][j] = true;
  int cnt = 0;
  op[ind++] = (make_pair(1, make_pair(i, j)));
  if (!v[i + 1][j]) cnt++;
  if (!v[i - 1][j]) cnt++;
  if (!v[i][j - 1]) cnt++;
  if (!v[i][j + 1]) cnt++;
  if (!v[i + 1][j]) d(i + 1, j);
  if (!v[i - 1][j]) d(i - 1, j);
  if (!v[i][j - 1]) d(i, j - 1);
  if (!v[i][j + 1]) d(i, j + 1);
  if (!(i == ri && j == rj)) {
    op[ind++] = (make_pair(3, make_pair(i, j)));
    op[ind++] = (make_pair(2, make_pair(i, j)));
  }
}
int main() {
  memset(v, 1, sizeof v);
  string s;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = 1; j <= m; j++) {
      if (s[j - 1] != '#') v[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!v[i][j]) {
        ri = i, rj = j;
        d(i, j);
      }
    }
  }
  int k = ind - 1;
  printf("%d\n", k);
  for (int i = 1; i < ind; i++) {
    pair<int, pair<int, int>> j = op[i];
    if (j.first == 1) {
      printf("B %d %d\n", j.second.first, j.second.second);
    } else if (j.first == 2) {
      printf("R %d %d\n", j.second.first, j.second.second);
    } else {
      printf("D %d %d\n", j.second.first, j.second.second);
    }
  }
  return 0;
}
