#include <bits/stdc++.h>
using namespace std;
const int inf = 5e2 + 9;
int n, m;
string a[inf];
bool vis[inf][inf];
vector<pair<char, pair<int, int> > > ans;
int cm = 0;
int idx[] = {0, 0, 1, -1};
int idy[] = {-1, 1, 0, 0};
int l, r;
void dfs(int i, int j) {
  vis[i][j] = 1;
  ans.push_back(make_pair('B', make_pair(i, j)));
  for (int z = 0; z < 4; z++) {
    int x = idx[z] + i;
    int y = idy[z] + j;
    if (x >= 0 && x < n && y >= 0 && y < m && !vis[x][y] && a[x][y] != '#')
      dfs(x, y);
  }
  if (i == l && j == r) return;
  ans.push_back(make_pair('D', make_pair(i, j)));
  ans.push_back(make_pair('R', make_pair(i, j)));
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      l = i, r = j;
      if (!vis[i][j] && a[i][j] != '#') dfs(i, j);
    }
  }
  cout << ans.size() << "\n";
  for (auto o : ans)
    printf("%c %d %d\n", o.first, o.second.first + 1, o.second.second + 1);
}
