#include <bits/stdc++.h>
using namespace std;
bool mark[502][502];
int n, m, cnt, p, q;
char a[502][502];
vector<pair<char, pair<int, int> > > t;
void dfs(int v, int x) {
  mark[v][x] = true;
  t.push_back(make_pair('B', make_pair(v, x)));
  if (a[v - 1][x] == '.' && !mark[v - 1][x]) dfs(v - 1, x);
  if (a[v][x - 1] == '.' && !mark[v][x - 1]) dfs(v, x - 1);
  if (a[v + 1][x] == '.' && !mark[v + 1][x]) dfs(v + 1, x);
  if (a[v][x + 1] == '.' && !mark[v][x + 1]) dfs(v, x + 1);
  if (v != p || x != q) {
    t.push_back(make_pair('D', make_pair(v, x)));
    t.push_back(make_pair('R', make_pair(v, x)));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!mark[i][j] && a[i][j] == '.') {
        p = i;
        q = j;
        dfs(i, j);
      }
    }
  }
  cout << t.size() << '\n';
  for (int i = 0; i < t.size(); i++)
    cout << t[i].first << " " << t[i].second.first << " " << t[i].second.second
         << '\n';
  return 0;
}
