#include <bits/stdc++.h>
using namespace std;
void bug() { cout << " " << endl; }
template <class T>
void bug(T a) {
  cout << a << "  ";
}
template <class T>
void bug(T* a, int n) {
  for (int i = 0; i < (int)(n); i++) bug(a[i]);
}
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
int n, m;
char s[555][555];
int vis[555][555];
pair<int, int> q[555 * 555];
int head, tail;
struct node {
  char c;
  int x, y;
  node(char c = ' ', int x = 0, int y = 0) : c(c), x(x), y(y) { ; }
};
node ans[1111111];
int total;
void do_it(int x, int y) {
  head = tail = 0;
  q[tail++] = make_pair(x, y);
  vis[x][y] = 1;
  while (tail - head > 0) {
    pair<int, int> cur = q[head++];
    for (int k = 0; k < (int)(4); k++) {
      int x = cur.first + dx[k];
      int y = cur.second + dy[k];
      if (x >= 0 && x < n && y >= 0 && y < m && s[x][y] != '#' && !vis[x][y]) {
        q[tail++] = make_pair(x, y);
        vis[x][y] = 1;
      }
    }
  }
  if (tail == 1) {
    ans[total++] = node('B', x, y);
  } else {
    for (int i = 0; i < (int)(tail); i++) {
      ans[total++] = node('B', q[i].first, q[i].second);
    }
    for (int i = tail - 1; i > 0; --i) {
      ans[total++] = node('D', q[i].first, q[i].second);
      ans[total++] = node('R', q[i].first, q[i].second);
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < (int)(n); i++)
    for (int j = 0; j < (int)(m); j++) cin >> s[i][j];
  for (int i = 0; i < (int)(n); i++)
    for (int j = 0; j < (int)(m); j++)
      if (s[i][j] != '#' && !vis[i][j]) do_it(i, j);
  printf("%d\n", total);
  for (int i = 0; i < (int)(total); i++) {
    printf("%c %d %d\n", ans[i].c, ans[i].x + 1, ans[i].y + 1);
  }
  return 0;
}
