#include <bits/stdc++.h>
using namespace std;
void oj() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long n, m;
string s[505];
bool vis[505][505];
vector<pair<char, pair<long long, long long>>> ans;
vector<pair<long long, long long>> v;
bool check(long long x, long long y) {
  if (x >= 0 && y >= 0 && x < n && y < m && !vis[x][y] && s[x][y] == '.')
    return true;
  return false;
}
void dfs(long long i, long long j) {
  if (!check(i, j)) return;
  vis[i][j] = true;
  v.push_back({i, j});
  dfs(i + 1, j);
  dfs(i - 1, j);
  dfs(i, j + 1);
  dfs(i, j - 1);
}
void doit() {
  for (long long i = 0; i < v.size(); i++) ans.push_back({'B', v[i]});
  long long i = v.size() - 1;
  while (i > 0) {
    ans.push_back({'D', v[i]});
    ans.push_back({'R', v[i]});
    i--;
  }
}
void solve() {
  cin >> n >> m;
  for (long long i = 0; i < n; i++) cin >> s[i];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) {
      if (s[i][j] == '#' || vis[i][j]) continue;
      v.clear();
      dfs(i, j);
      doit();
    }
  cout << ans.size() << "\n";
  for (auto el : ans)
    cout << el.first << " " << el.second.first + 1 << " "
         << el.second.second + 1 << "\n";
}
signed main() {
  oj();
  solve();
  return 0;
}
