#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9;
const double eps = 1e-15;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int n, m, numOp, rootX, rootY;
bool vis[505][505];
char grid[505][505];
stringstream out;
void dfs(int x, int y) {
  vis[x][y] = true;
  for (int i = 0; i < int(4); ++i) {
    int to_x = x + dx[i], to_y = y + dy[i];
    if (grid[to_x][to_y] == '.' && !vis[to_x][to_y]) dfs(to_x, to_y);
  }
  if (!(x == rootX && y == rootY))
    out << "D " << x << ' ' << y << "\nR " << x << ' ' << y << '\n', numOp += 2;
}
int main() {
  ios::sync_with_stdio(false);
  cout.precision(15);
  cin >> n >> m;
  for (int i = 1; i < int(n + 1); ++i)
    for (int j = 1; j < int(m + 1); ++j) cin >> grid[i][j];
  for (int i = 1; i < int(n + 1); ++i)
    for (int j = 1; j < int(m + 1); ++j)
      if (grid[i][j] == '.') {
        out << "B " << i << ' ' << j << '\n';
        ++numOp;
      }
  for (int i = 1; i < int(n + 1); ++i)
    for (int j = 1; j < int(m + 1); ++j)
      if (grid[i][j] == '.' && !vis[i][j]) rootX = i, rootY = j, dfs(i, j);
  cout << numOp << '\n' << out.str();
  return 0;
}
