#include <bits/stdc++.h>
using namespace std;
int n, m, cnt, rx, ry;
int dx[] = {0, -1, 1, 0};
int dy[] = {1, 0, 0, -1};
bool s[505][505], vis[505][505];
struct node {
  char op;
  int x, y;
  node() { x = y = op = 0; }
  node(char a, int b, int c) { op = a, x = b, y = c; }
};
vector<node> res;
inline bool valid(int x, int y) {
  return x >= 1 && x <= n && y >= 1 && y <= m && s[x][y] && !vis[x][y];
}
inline bool nott(int x, int y) { return x == rx && y == ry; }
void dfs(int x, int y) {
  bool f = false;
  {
    vis[x][y] = true;
    res.push_back(node('B', x, y));
    ++cnt;
  }
  for (int i = 0; i < 4; ++i) {
    int xx = x + dx[i], yy = y + dy[i];
    if (valid(xx, yy)) {
      f = true;
      vis[xx][yy] = true;
      dfs(xx, yy);
    }
  }
  if (!nott(x, y)) {
    cnt += 2;
    res.push_back(node('D', x, y));
    res.push_back(node('R', x, y));
  }
}
int main(int argc, char const *argv[]) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    char t[505];
    scanf("%s", t);
    for (int j = 0; t[j]; ++j) s[i][j + 1] = (t[j] == '.');
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      if (s[i][j] && !vis[i][j]) {
        rx = i, ry = j;
        dfs(i, j);
      }
    }
  printf("%d\n", cnt);
  for (int i = 0; i < res.size(); ++i)
    printf("%c %d %d\n", res[i].op, res[i].x, res[i].y);
  return 0;
}
