#include <bits/stdc++.h>
#pragma optimization_level 3
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long N = 505;
const long long mod = 1e9 + 7;
const long long INF = 0x7f7f7f7f7f7f7f7f;
const int INFi = 0x7f7f7f7f;
long long test = 1, n, m;
string a[N];
vector<pair<long long, long long> > ans;
vector<char> ch;
long long dfs(long long i, long long j, long long first) {
  ans.push_back({i, j});
  ch.push_back('B');
  a[i][j] = '#';
  if (a[i - 1][j] != '#') {
    dfs(i - 1, j, 0);
  }
  if (a[i + 1][j] != '#') {
    dfs(i + 1, j, 0);
  }
  if (a[i][j - 1] != '#') {
    dfs(i, j - 1, 0);
  }
  if (a[i][j + 1] != '#') {
    dfs(i, j + 1, 0);
  }
  if (first != 1) {
    ans.push_back({i, j});
    ch.push_back('D');
    ans.push_back({i, j});
    ch.push_back('R');
  }
}
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] = '#' + a[i] + '#';
  }
  a[0] = a[n + 1] = string(m + 2, '#');
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] != '#') dfs(i, j, 1);
    }
  }
  long long sz = ans.size();
  cout << sz << "\n";
  for (int i = 0; i < sz; i++) {
    cout << ch[i] << " " << ans[i].first << " " << ans[i].second << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  ;
  for (int i = 1; i <= test; i++) {
    solve();
  }
}
