#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1};
vector<char> ans;
vector<pair<int, int> > ansn;
int n, m;
string field[510];
void dfs(int x, int y, bool isroot) {
  field[y][x] = '*';
  ans.push_back('B');
  ansn.push_back(make_pair(x + 1, y + 1));
  for (int i = 0; i < 4; i++) {
    int nx = x + dx[i], ny = y + dy[i];
    if (nx < 0 || nx >= m || ny < 0 || ny >= n) {
      continue;
    }
    if (field[ny][nx] == '.') {
      dfs(nx, ny, false);
    }
  }
  if (!isroot) {
    ans.push_back('D');
    ansn.push_back(make_pair(x + 1, y + 1));
    ans.push_back('R');
    ansn.push_back(make_pair(x + 1, y + 1));
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> field[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (field[i][j] == '.') {
        dfs(j, i, true);
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    printf("%c %d %d\n", ans[i], ansn[i].second, ansn[i].first);
  }
  return 0;
}
