#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
void base() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
string mmap[550];
bool vis[550][550];
vector<pair<char, pair<int, int> > > ans;
int dix[] = {1, -1, 0, 0};
int diy[] = {0, 0, 1, -1};
int n, m;
void dfs(int i, int j, int co) {
  if (vis[i][j]) return;
  vis[i][j] = true;
  bool valid = false;
  for (int k = 0; k < 4; k++) {
    int tx = i + dix[k], ty = j + diy[k];
    if (tx < 0 || ty < 0 || tx >= n || ty >= m) continue;
    if (mmap[tx][ty] == '#' || vis[tx][ty]) continue;
    valid = true;
  }
  if (!valid) {
    if (co == 0)
      ans.push_back({'B', {i + 1, j + 1}});
    else
      ans.push_back({'R', {i + 1, j + 1}});
    return;
  }
  ans.push_back({'B', {i + 1, j + 1}});
  for (int k = 0; k < 4; k++) {
    int tx = i + dix[k], ty = j + diy[k];
    if (tx < 0 || ty < 0 || tx >= n || ty >= m) continue;
    if (mmap[tx][ty] == '#') continue;
    dfs(tx, ty, co + 1);
  }
  if (co != 0) {
    ans.push_back({'D', {i + 1, j + 1}});
    ans.push_back({'R', {i + 1, j + 1}});
  }
  return;
}
int main() {
  base();
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> mmap[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (mmap[i][j] == '.' && !vis[i][j]) {
        dfs(i, j, 0);
      }
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second.first << " "
         << ans[i].second.second << "\n";
  }
  return 0;
}
