#include <bits/stdc++.h>
using namespace std;
inline long long int Pow(long long int a, long long int b, long long int mod) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
string str;
int plot[501][501], n, m;
vector<pair<char, pair<int, int> > > sol;
void build(int i, int j, int destroy) {
  if (i > 0 && i <= n && j > 0 && j <= m) {
    plot[i][j] = 0;
    sol.push_back(make_pair('B', make_pair(i, j)));
    if (plot[i][j + 1]) build(i, j + 1, 1);
    if (plot[i][j - 1]) build(i, j - 1, 1);
    if (plot[i + 1][j]) build(i + 1, j, 1);
    if (plot[i - 1][j]) build(i - 1, j, 1);
    if (destroy) {
      sol.push_back(make_pair('D', make_pair(i, j)));
      sol.push_back(make_pair('R', make_pair(i, j)));
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = int(1); i <= int(n); i++) {
    cin >> str;
    for (int j = int(0); j <= int(str.length() - 1); j++)
      if (str[j] == '.') plot[i][j + 1] = 1;
  }
  for (int i = int(1); i <= int(n); i++)
    for (int j = int(1); j <= int(m); j++)
      if (plot[i][j]) build(i, j, 0);
  cout << sol.size() << "\n";
  for (int i = int(0); i <= int(sol.size() - 1); i++)
    cout << sol[i].first << " " << sol[i].second.first << " "
         << sol[i].second.second << "\n";
  return 0;
}
