#include <bits/stdc++.h>
using namespace std;
int n, m, ans = 0;
int dx[] = {0, 0, -1, 1}, dy[] = {-1, 1, 0, 0};
char g[505][505];
bool vis[505][505];
int type[1000005], xx[1000005], yy[1000005];
void dfs(int x, int y, int f) {
  if (x < 1 || x > n || y < 1 || y > m) return;
  if (g[x][y] == '#') return;
  if (vis[x][y]) return;
  vis[x][y] = 1;
  type[ans] = 0;
  xx[ans] = x;
  yy[ans++] = y;
  for (int i = 0; i < 4; i++) {
    int nx = x + dx[i], ny = y + dy[i];
    dfs(nx, ny, 1);
  }
  if (f != -1) {
    type[ans] = 1;
    xx[ans] = x;
    yy[ans++] = y;
    type[ans] = 2;
    xx[ans] = x;
    yy[ans++] = y;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", g[i] + 1);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!vis[i][j]) dfs(i, j, -1);
    }
  }
  printf("%d\n", ans);
  for (int i = 0; i < ans; i++) {
    if (type[i] == 0)
      printf("B %d %d\n", xx[i], yy[i]);
    else if (type[i] == 1)
      printf("D %d %d\n", xx[i], yy[i]);
    else
      printf("R %d %d\n", xx[i], yy[i]);
  }
  return 0;
}
