#include <bits/stdc++.h>
using namespace std;
char grid[500][501];
int n, m, moves[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}, nc, nr, res;
stringstream solution;
void dfs(int r, int c, bool first = false) {
  res += 1;
  solution << "B " << r + 1 << ' ' << c + 1 << endl;
  grid[r][c] = '#';
  for (int _n = 4, i = 0; i < _n; ++i) {
    nr = r + moves[i][0];
    nc = c + moves[i][1];
    if (nr < 0 || nr >= n) continue;
    if (nc < 0 || nc >= m) continue;
    if (grid[nr][nc] != '.') continue;
    dfs(nr, nc);
  }
  if (!first) {
    res += 2;
    solution << "D " << r + 1 << ' ' << c + 1 << endl;
    solution << "R " << r + 1 << ' ' << c + 1 << endl;
  }
}
int main() {
  cin >> n >> m;
  for (int _n = n, i = 0; i < _n; ++i) cin >> grid[i];
  for (int _n = n, i = 0; i < _n; ++i)
    for (int _n = m, j = 0; j < _n; ++j)
      if (grid[i][j] == '.') dfs(i, j, true);
  cout << res << endl;
  cout << solution.str();
  return 0;
}
