#include <bits/stdc++.h>
using namespace std;
const int N = 510;
char s[N][N];
bool vis[N][N];
int fx[4] = {0, 0, 1, -1};
int fy[4] = {1, -1, 0, 0};
int m, n;
struct node {
  char op;
  int x, y;
  node(char a, int b, int c) {
    op = a;
    x = b;
    y = c;
  }
};
vector<node> vec;
bool out(int x, int y) {
  if (x < 0 && x >= m) return 0;
  if (y < 0 || y >= n) return 0;
  return 1;
}
void dfs(int x, int y, int z) {
  vis[x][y] = true;
  bool ok = false;
  for (int i = 0; i < 4; ++i) {
    int newx = x + fx[i];
    int newy = y + fy[i];
    if (out(newx, newy) && !vis[newx][newy] && s[newx][newy] == '.') {
      ok = true;
      break;
    }
  }
  if (!ok && z) {
    vec.push_back(node('R', x, y));
    return;
  }
  vec.push_back(node('B', x, y));
  for (int i = 0; i < 4; ++i) {
    int newx = x + fx[i];
    int newy = y + fy[i];
    if (out(newx, newy) && !vis[newx][newy] && s[newx][newy] == '.') {
      dfs(newx, newy, 1);
    }
  }
  if (z) {
    vec.push_back(node('D', x, y));
    vec.push_back(node('R', x, y));
  }
}
int main() {
  scanf("%d%d", &m, &n);
  for (int i = 0; i < m; ++i) scanf("%s", s[i]);
  memset(vis, false, sizeof(vis));
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) {
      if (!vis[i][j] && s[i][j] == '.') {
        dfs(i, j, 0);
      }
    }
  }
  int len = vec.size();
  printf("%d\n", len);
  for (int i = 0; i < len; ++i) {
    printf("%c %d %d\n", vec[i].op, vec[i].x + 1, vec[i].y + 1);
  }
  return 0;
}
