#include <bits/stdc++.h>
using namespace std;
char grid[512][512];
bool used[512][512];
int n, m;
struct op {
  char type;
  int x, y;
  op() {}
  op(char c, int a, int b) {
    type = c;
    x = a;
    y = b;
  }
};
vector<op> res;
int dx[4] = {0, -1, 0, 1};
int dy[4] = {1, 0, -1, 0};
void go(int x, int y, int level) {
  if (x < 1 || x > n || y > m || y < 1) return;
  if (used[x][y]) return;
  used[x][y] = 1;
  for (int i = 0; i < 4; i++) {
    go(x + dx[i], y + dy[i], level + 1);
  }
  if (level) {
    res.push_back(op('D', x, y));
    res.push_back(op('R', x, y));
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> grid[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (grid[i][j] == '.')
        res.push_back(op('B', i, j));
      else
        used[i][j] = 1;
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (!used[i][j]) {
        go(i, j, 0);
      }
    }
  int k = res.size();
  cout << k << endl;
  for (int i = 0; i < k; i++) {
    cout << res[i].type << ' ' << res[i].x << ' ' << res[i].y << endl;
  }
  return 0;
}
