#include <bits/stdc++.h>
using namespace std;
char a[503][503];
bool vis[503][503];
int n, m;
int X[] = {0, 0, 1, -1};
int Y[] = {1, -1, 0, 0};
vector<pair<char, pair<int, int> > > ans;
void go(int nowx, int nowy, int par) {
  vis[nowx][nowy] = true;
  ans.push_back(make_pair('B', make_pair(nowx, nowy)));
  for (int i = 0; i < 4; i++) {
    int tox = nowx + X[i], toy = nowy + Y[i];
    if (tox < 1 || tox > n || toy < 1 || toy > m || vis[tox][toy] ||
        a[tox][toy] == '#')
      continue;
    go(tox, toy, 0);
  }
  if (par != -1) {
    ans.push_back(make_pair('D', make_pair(nowx, nowy)));
    ans.push_back(make_pair('R', make_pair(nowx, nowy)));
  }
}
int main() {
  int i, j;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      scanf(" %c", &a[i][j]);
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (!vis[i][j] && a[i][j] == '.') {
        go(i, j, -1);
      }
    }
  }
  printf("%d\n", ans.size());
  for (i = 0; i < ans.size(); i++)
    printf("%c %d %d\n", ans[i].first, ans[i].second.first,
           ans[i].second.second);
  return 0;
}
