#include <bits/stdc++.h>
using namespace std;
char a[505][505];
char res[1000000];
int xx[1000000], yy[1000000], v, m, n;
inline void dfs(int i, int j, int x, int y) {
  if (a[i][j] != '.' || i < 1 || j < 1 || i > m || j > n) return;
  v++;
  a[i][j] = 'B';
  res[v] = 'B';
  xx[v] = i;
  yy[v] = j;
  dfs(i + 1, j, i, j);
  dfs(i - 1, j, i, j);
  dfs(i, j + 1, i, j);
  dfs(i, j - 1, i, j);
  if (a[x][y] == 'B')
    v++, a[i][j] = 'R', res[v] = 'D', xx[v] = i, yy[v] = j, v++, res[v] = 'R',
         xx[v] = i, yy[v] = j;
}
int main() {
  int i, j;
  cin >> m >> n;
  char c[505], x;
  for (i = 1; i <= m; i++) {
    scanf("%s", &c);
    for (j = 1; j <= n; j++) a[i][j] = c[j - 1];
  }
  a[0][0] = '#';
  for (i = 1; i <= m; i++)
    for (j = 1; j <= n; j++)
      if (a[i][j] == '.') dfs(i, j, 0, 0);
  printf("%d", v);
  puts("");
  for (i = 1; i <= v; i++) printf("%c %d %d", res[i], xx[i], yy[i]), puts("");
  return 0;
}
