#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-9;
int INF = 2000000000;
long long INFF = 8000000000000000000LL;
double PI = acos(-1);
int steps;
int n, m;
int b1[5000000], c1[5000000];
char a1[5000000];
void dfs(int a, int b, vector<vector<bool> > &flag, bool temp) {
  flag[a][b] = false;
  a1[steps] = 'B';
  b1[steps] = a + 1;
  c1[steps] = b + 1;
  steps++;
  for (int i = -1; i <= 1; i++) {
    for (int j = -1; j <= 1; j++) {
      if (abs(i) == abs(j)) continue;
      int new_a = a + i, new_b = b + j;
      if (new_a < 0 || new_b < 0 || new_a >= n || new_b >= m ||
          flag[new_a][new_b] == false)
        continue;
      dfs(new_a, new_b, flag, false);
    }
  }
  if (temp) return;
  a1[steps] = 'D';
  b1[steps] = a + 1;
  c1[steps] = b + 1;
  steps++;
  a1[steps] = 'R';
  b1[steps] = a + 1;
  c1[steps] = b + 1;
  steps++;
  return;
}
int main() {
  steps = 0;
  cin >> n >> m;
  vector<vector<bool> > flag(n, vector<bool>(m, true));
  vector<vector<char> > g(n, vector<char>(m, '.'));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> g[i][j];
      if (g[i][j] == '#') flag[i][j] = false;
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (flag[i][j]) dfs(i, j, flag, true);
  printf("%d\n", steps);
  for (int i = 0; i < steps; i++) {
    printf("%c %d %d\n", a1[i], b1[i], c1[i]);
  }
  return 0;
}
