#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int n, m;
char mpt[510][510];
bool vis[510][510];
struct node {
  int x, y;
  string cmmd;
  node(string cmmd, int x, int y) {
    this->cmmd = cmmd;
    this->x = x;
    this->y = y;
  }
};
vector<node> ans;
int fx[][2] = {{1, 0},
               {
                   -1,
                   0,
               },
               {0, 1},
               {0, -1}};
void dfs(int x, int y, int c) {
  int xx, yy;
  vis[x][y] = true;
  ans.push_back(node("B", x, y));
  bool bj = false;
  for (int i = 0; i < 4; i++) {
    xx = x + fx[i][0];
    yy = y + fx[i][1];
    if (xx < 1 || xx > n || yy < 1 || yy > m || mpt[xx][yy] != '.' ||
        vis[xx][yy] == true)
      continue;
    dfs(xx, yy, c + 1);
    bj = true;
  }
  if (c != 1) {
    ans.push_back(node("D", x, y));
    ans.push_back(node("R", x, y));
  }
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    ans.clear();
    memset(vis, 0, sizeof vis);
    for (int i = 1; i <= n; i++) {
      scanf("%s", mpt[i] + 1);
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        if (vis[i][j] == false && mpt[i][j] == '.') dfs(i, j, 1);
      }
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%s %d %d\n", ans[i].cmmd.c_str(), ans[i].x, ans[i].y);
    }
  }
  return 0;
}
