#include <bits/stdc++.h>
using namespace std;
int n, m;
bool vis[610][610];
char s[610][610];
vector<pair<char, pair<int, int>>> ans;
bool isInside(int r, int c) {
  if (r >= 1 && c >= 1 && r <= n && c <= m) return true;
  return false;
}
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
void dfs(int r, int c) {
  vis[r][c] = 1;
  bool f = 0;
  int x, y;
  s[r - 1][c - 1] = 'B';
  ans.push_back({'B', {r, c}});
  for (int i = 0; i < 4; i++) {
    x = dx[i] + r;
    y = dy[i] + c;
    if (isInside(x, y) && !vis[x][y] && s[x - 1][y - 1] == '.') dfs(x, y);
  }
  if (s[r - 1][c - 1] == 'B') {
    f = 0;
    for (int i = 0; i < 4; i++) {
      x = dx[i] + r;
      y = dy[i] + c;
      if (isInside(x, y) && s[x - 1][y - 1] == 'B') {
        f = 1;
        break;
      }
    }
    if (f)
      ans.push_back({'D', {r, c}}), ans.push_back({'R', {r, c}}),
          s[r - 1][c - 1] = 'R';
  }
}
int main() {
  int i, j, k;
  int u, v, w;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) scanf("%s", s[i]);
  memset(vis, 0, sizeof(vis));
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (!vis[i][j] && s[i - 1][j - 1] == '.') dfs(i, j);
    }
  }
  k = ans.size();
  printf("%d\n", k);
  for (i = 0; i < k; i++)
    printf("%c %d %d\n", ans[i].first, ans[i].second.first,
           ans[i].second.second);
  return 0;
}
