#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
bool viz[506][506];
int color[506 * 506 * 4];
pair<int, int> result[506 * 506 * 4];
int K, j, i, n, m;
string s;
int a[506][506];
int radi, radj;
void dfs(int i, int j) {
  viz[i][j] = true;
  for (int t = 0; t < 4; ++t)
    if (viz[i + dx[t]][j + dy[t]] == false && i + dx[t] > 0 && i + dx[t] <= n &&
        j + dy[t] > 0 && j + dy[t] <= m)
      if (a[i + dx[t]][j + dy[t]] == 0) dfs(i + dx[t], j + dy[t]);
  if (i == radi && j == radj) return;
  result[++K] = make_pair(i, j);
  color[K] = 'D';
  result[++K] = make_pair(i, j);
  color[K] = 'R';
}
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; ++i) {
    cin >> s;
    for (j = 0; j < m; ++j) a[i][j + 1] = (s[j] == '#' ? 1 : 0);
  }
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= m; ++j)
      if (a[i][j] == 0) {
        result[++K] = make_pair(i, j);
        color[K] = 'B';
      }
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= m; ++j)
      if (viz[i][j] == false && a[i][j] != 1) {
        radi = i;
        radj = j;
        dfs(i, j);
      }
  cout << K << '\n';
  for (i = 1; i <= K; ++i)
    cout << (char)(color[i]) << " " << result[i].first << " "
         << result[i].second << '\n';
  return 0;
}
