#include <bits/stdc++.h>
using namespace std;
int mark[502][502];
int rx, ry;
vector<int> oper;
void dfs(int x, int y) {
  if (mark[x][y]) return;
  mark[x][y] = true;
  oper.push_back(-1);
  oper.push_back(y);
  oper.push_back(x);
  dfs(x - 1, y);
  dfs(x + 1, y);
  dfs(x, y - 1);
  dfs(x, y + 1);
  if ((x != rx) || (y != ry)) {
    oper.push_back(-3);
    oper.push_back(y);
    oper.push_back(x);
    oper.push_back(-2);
    oper.push_back(y);
    oper.push_back(x);
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      char ch;
      cin >> ch;
      if (ch == '#') mark[j][i] = true;
    }
  for (int i = 0; i < 502; i++) {
    mark[0][i] = 1;
    mark[m + 1][i] = 1;
    mark[i][0] = 1;
    mark[i][n + 1] = 1;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (!mark[j][i]) {
        rx = j;
        ry = i;
        dfs(rx, ry);
      }
  printf("%d \n", oper.size() / 3);
  for (int i = 0; i < oper.size(); i += 3) {
    if (oper[i] == -1) printf("B %d %d \n", oper[i + 1], oper[i + 2]);
    if (oper[i] == -2) printf("R %d %d \n", oper[i + 1], oper[i + 2]);
    if (oper[i] == -3) printf("D %d %d \n", oper[i + 1], oper[i + 2]);
  }
  return 0;
}
