#include <bits/stdc++.h>
using namespace std;
const int nmax = 505;
char grid[nmax][nmax];
bool visited[nmax][nmax];
int n, m;
bool open(int r, int c) {
  if (r == 0 || c == 0 || r > n || c > m) return false;
  if (visited[r][c]) return false;
  return grid[r][c] == '.';
}
vector<char> type;
vector<int> row, col;
void bfs(int r, int c) {
  vector<pair<int, int> > arr;
  arr.push_back(make_pair(r, c));
  visited[r][c] = true;
  for (int i = 0; i < arr.size(); ++i) {
    r = arr[i].first, c = arr[i].second;
    if (open(r + 1, c)) {
      visited[r + 1][c] = true;
      arr.push_back(make_pair(r + 1, c));
    }
    if (open(r - 1, c)) {
      visited[r - 1][c] = true;
      arr.push_back(make_pair(r - 1, c));
    }
    if (open(r, c + 1)) {
      visited[r][c + 1] = true;
      arr.push_back(make_pair(r, c + 1));
    }
    if (open(r, c - 1)) {
      visited[r][c - 1] = true;
      arr.push_back(make_pair(r, c - 1));
    }
  }
  for (int i = 0; i < arr.size(); ++i) {
    type.push_back('B');
    row.push_back(arr[i].first);
    col.push_back(arr[i].second);
  }
  reverse(arr.begin(), arr.end());
  for (int i = 0; i < arr.size() - 1; ++i) {
    type.push_back('D');
    row.push_back(arr[i].first);
    col.push_back(arr[i].second);
    type.push_back('R');
    row.push_back(arr[i].first);
    col.push_back(arr[i].second);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> grid[i][j];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (open(i, j)) bfs(i, j);
  cout << type.size() << '\n';
  for (int i = 0; i < type.size(); ++i)
    cout << type[i] << ' ' << row[i] << ' ' << col[i] << '\n';
}
