#include <bits/stdc++.h>
using namespace std;
const double eps = 1.0e-11;
const double pi = acos(-1.0);
int n, m;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
string d[550];
bool used[550][550];
vector<pair<char, pair<int, int> > > res;
void dfs(int x, int y, int root = true) {
  used[x][y] = true;
  res.push_back(make_pair('B', make_pair(x, y)));
  for (long long dir = 0; dir < 4; dir++) {
    int nx = x + dx[dir], ny = y + dy[dir];
    if (nx >= 0 && nx < n && ny >= 0 && ny < m && !used[nx][ny] &&
        d[nx][ny] == '.')
      dfs(nx, ny, false);
  }
  if (!root) {
    res.push_back(make_pair('D', make_pair(x, y)));
    res.push_back(make_pair('R', make_pair(x, y)));
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (long long i = 0; i < n; i++) cin >> d[i];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) {
      if (d[i][j] == '.' && !used[i][j]) dfs(i, j);
    }
  cout << (int)(res).size() << endl;
  for (auto x : res)
    cout << x.first << " " << x.second.first + 1 << " " << x.second.second + 1
         << "\n";
  return 0;
}
