#include <bits/stdc++.h>
using namespace std;
string arr[505];
int n, m;
int startx = -1, starty = -1;
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
int vis[505][505];
struct Oper {
  char x;
  int y, z;
};
bool valid(int i, int j) { return i >= 0 && j >= 0 && i < n && j < m; }
vector<Oper> v;
void DFS(int i, int j) {
  vis[i][j] = 1;
  v.push_back({'B', i, j});
  for (int k = 0; k < 4; k++) {
    int x = i + dx[k], y = j + dy[k];
    if (valid(x, y) && arr[x][y] != '#' && !vis[x][y]) DFS(x, y);
  }
  if (i != startx || j != starty) {
    v.push_back({'D', i, j});
    v.push_back({'R', i, j});
  }
}
int main() {
  cin >> n >> m;
  memset(vis, 0, sizeof vis);
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (arr[i][j] == '.' && !vis[i][j]) {
        startx = i, starty = j;
        DFS(i, j);
      }
    }
  }
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); i++) {
    cout << v[i].x << " " << v[i].y + 1 << " " << v[i].z + 1 << "\n";
  }
  return 0;
}
