#include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 0, -1, 1};
const int dy[] = {1, -1, 0, 0};
const int N = 505;
int n, m;
char adj[N][N];
bool vis[N][N];
struct node {
  int type, x, y;
  node() {}
  node(int type, int x, int y) : type(type), x(x), y(y) {}
  void print() {
    if (type == 0)
      putchar('B');
    else if (type == 1)
      putchar('R');
    else
      putchar('D');
    printf(" %d %d\n", x + 1, y + 1);
  }
};
vector<node> ans;
void dfs(int x, int y) {
  vis[x][y] = 1;
  for (int i = 0; i < 4; i++) {
    int xx = x + dx[i];
    int yy = y + dy[i];
    if (xx >= 0 && xx < n && yy >= 0 && yy < m && vis[xx][yy] == 0) {
      ans.push_back(node(0, xx, yy));
      dfs(xx, yy);
      ans.push_back(node(2, xx, yy));
      ans.push_back(node(1, xx, yy));
    }
  }
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    ans.clear();
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < n; i++) scanf("%s", adj[i]);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (adj[i][j] == '#') vis[i][j] = 1;
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++)
        if (vis[i][j] == 0) {
          ans.push_back(node(0, i, j));
          dfs(i, j);
        }
    }
    int len = (int)ans.size();
    printf("%d\n", len);
    for (int i = 0; i < len; i++) ans[i].print();
  }
  return 0;
}
