#include <bits/stdc++.h>
using namespace std;
int n, m;
bool vis[505][505];
char s[505][505];
struct cmd {
  int x, y, tp;
};
vector<cmd> V, V2;
pair<int, int> q[250005];
int l, r;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  scanf("%d %d", &n, &m);
  for (int i = (1); i <= (n); i++) {
    scanf(" %s", s[i] + 1);
    for (int j = (1); j <= (m); j++) {
      if (s[i][j] == '.')
        V.push_back((cmd){i, j, 1});
      else
        vis[i][j] = true;
    }
  }
  for (int i = (1); i <= (n); i++)
    for (int j = (1); j <= (m); j++) {
      if (!vis[i][j]) {
        vis[i][j] = true;
        l = r = 0;
        q[r++] = make_pair(i, j);
        while (l < r) {
          int cx = q[l].first;
          int cy = q[l].second;
          l++;
          for (int i = (0); i <= (3); i++) {
            int nx = cx + dx[i];
            int ny = cy + dy[i];
            if (nx <= 0 || nx > n || ny <= 0 || ny > m) continue;
            if (vis[nx][ny]) continue;
            vis[nx][ny] = true;
            q[r++] = make_pair(nx, ny);
            V2.push_back((cmd){nx, ny, 2});
            V2.push_back((cmd){nx, ny, 3});
          }
        }
        while (!V2.empty()) {
          V.push_back(V2.back());
          V2.pop_back();
        }
      }
    }
  int sz = V.size();
  printf("%d\n", sz);
  for (int i = (0); i <= (sz - 1); i++) {
    char c;
    if (V[i].tp == 1)
      c = 'B';
    else if (V[i].tp == 2)
      c = 'R';
    else
      c = 'D';
    printf("%c %d %d\n", c, V[i].x, V[i].y);
  }
  return 0;
}
