#include <bits/stdc++.h>
using namespace std;
const pair<int, int> moves[4] = {make_pair(1, 0), make_pair(-1, 0),
                                 make_pair(0, -1), make_pair(0, 1)};
void dfs(int x, int y, int n, int m, vector<vector<char> >& table,
         vector<vector<int> >& mark,
         vector<pair<char, pair<int, int> > >& res) {
  mark[x][y] = 1;
  res.push_back(make_pair('B', make_pair(x, y)));
  for (int i = 0; i < 4; i++) {
    int newx = x + moves[i].first;
    int newy = y + moves[i].second;
    if (newx >= 0 && newx < n && newy >= 0 && newy < m &&
        table[newx][newy] == '.' && mark[newx][newy] == 0)
      dfs(newx, newy, n, m, table, mark, res);
  }
  res.push_back(make_pair('D', make_pair(x, y)));
  res.push_back(make_pair('R', make_pair(x, y)));
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<char> > table(n, vector<char>(m));
  vector<vector<int> > mark(n, vector<int>(m));
  vector<pair<char, pair<int, int> > > res;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> table[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (mark[i][j] == 0 && table[i][j] == '.') {
        dfs(i, j, n, m, table, mark, res);
        res.pop_back();
        res.pop_back();
      }
  cout << res.size() << '\n';
  for (int i = 0; i < res.size(); i++)
    cout << res[i].first << ' ' << res[i].second.first + 1 << ' '
         << res[i].second.second + 1 << '\n';
  return 0;
}
