#include <bits/stdc++.h>
using namespace std;
int n, m, x;
char f[550][550];
int used[550][550];
vector<pair<int, pair<int, int> > > oper;
void dfs(int i, int j, int root) {
  oper.push_back(make_pair((1), (make_pair((i), (j)))));
  used[i][j] = 1;
  if (!used[i - 1][j] && f[i - 1][j] != '#') dfs(i - 1, j, 0);
  if (!used[i + 1][j] && f[i + 1][j] != '#') dfs(i + 1, j, 0);
  if (!used[i][j - 1] && f[i][j - 1] != '#') dfs(i, j - 1, 0);
  if (!used[i][j + 1] && f[i][j + 1] != '#') dfs(i, j + 1, 0);
  if (!root) {
    oper.push_back(make_pair((2), (make_pair((i), (j)))));
    oper.push_back(make_pair((3), (make_pair((i), (j)))));
  }
}
int main() {
  memset(f, '#', sizeof(f));
  cin >> n >> m;
  for (int(i) = (1); (i) <= (n); ++(i)) {
    scanf("%s", &f[i][1]);
    f[i][1 + strlen(&f[i][1])] = '#';
  }
  for (int(i) = (1); (i) <= (n); ++(i))
    for (int(j) = (1); (j) <= (m); ++(j))
      if (!used[i][j] && f[i][j] != '#') {
        dfs(i, j, 1);
      }
  cout << oper.size() << endl;
  for (int i = 0; i < oper.size(); i++) {
    if (oper[i].first == 1) {
      printf("B %d %d\n", oper[i].second.first, oper[i].second.second);
    }
    if (oper[i].first == 2) {
      printf("D %d %d\n", oper[i].second.first, oper[i].second.second);
    }
    if (oper[i].first == 3) {
      printf("R %d %d\n", oper[i].second.first, oper[i].second.second);
    }
  }
  return 0;
}
