#include <bits/stdc++.h>
using namespace std;
int v[1000001][3];
int n, m, num = 0;
char grid[1001][1001];
void dfs(int lev, int x, int y) {
  if (grid[x][y] == '.') {
    v[num][0] = 'B';
    v[num][1] = x;
    v[num][2] = y;
    ++num;
    grid[x][y] = 'B';
    dfs(lev + 1, x + 1, y);
    dfs(lev + 1, x - 1, y);
    dfs(lev + 1, x, y + 1);
    dfs(lev + 1, x, y - 1);
    if (lev) {
      v[num][0] = 'D';
      v[num][1] = x;
      v[num][2] = y;
      num++;
      v[num][0] = 'R';
      v[num][1] = x;
      v[num][2] = y;
      num++;
      grid[x][y] = 'R';
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", grid[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (grid[i][j] == '.') dfs(0, i, j);
  printf("%d\n", num);
  for (int i = 0; i < num; i++) printf("%c %d %d\n", v[i][0], v[i][1], v[i][2]);
  return 0;
}
