#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000;
char Board[Maxn][Maxn], Sts[Maxn * Maxn];
bool Mark[Maxn][Maxn];
int n, m, first[Maxn * Maxn], second[Maxn * Maxn], cnt;
void Dfs(int X, int Y, bool IsRout) {
  if (X < 1 or X > n or Y > m or Y < 1 or Board[X][Y] == '#' or Mark[X][Y])
    return;
  Mark[X][Y] = true;
  first[cnt] = X;
  second[cnt] = Y;
  Sts[cnt] = 'B';
  cnt++;
  Dfs(X + 1, Y, false);
  Dfs(X, Y + 1, false);
  Dfs(X - 1, Y, false);
  Dfs(X, Y - 1, false);
  if (!IsRout) {
    first[cnt] = X;
    second[cnt] = Y;
    Sts[cnt] = 'D';
    cnt++;
    first[cnt] = X;
    second[cnt] = Y;
    Sts[cnt] = 'R';
    cnt++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> Board[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (!Mark[i][j]) Dfs(i, j, true);
  cout << cnt << endl;
  for (int i = 0; i < cnt; i++)
    cout << Sts[i] << " " << first[i] << " " << second[i] << endl;
}
