#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
struct P {
  int x, y;
  bool operator<(const P o) const { return x > o.x; }
};
int m[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
vector<pair<char, pair<int, int> > > ans;
string s[555];
void dfs(int i, int j) {
  ans.push_back(make_pair('B', make_pair(i, j)));
  s[i][j] = 'B';
  for (int k = (0); k < (int)(4); k++) {
    int ii = i + m[k][0];
    int jj = j + m[k][1];
    if (s[ii][jj] == '.') {
      dfs(ii, jj);
      ans.push_back(make_pair('D', make_pair(ii, jj)));
      ans.push_back(make_pair('R', make_pair(ii, jj)));
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = (0); i < (int)(n); i++) {
    cin >> s[i + 1];
    s[i + 1] = " " + s[i + 1];
  }
  for (int i = (0); i < (int)(n); i++)
    for (int j = (0); j < (int)(m); j++) {
      if (s[i + 1][j + 1] == '.') {
        dfs(i + 1, j + 1);
      }
    }
  cout << ((int)(ans).size()) << endl;
  for (int i = (0); i < (int)(((int)(ans).size())); i++) {
    cout << ans[i].first << " " << ans[i].second.first << " "
         << ans[i].second.second << endl;
  }
  return 0;
}
