#include <bits/stdc++.h>
using namespace std;
string mat[600];
vector<pair<pair<int, int>, int> > operations;
int visited[600][600];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
int n, m;
void dfs(pair<int, int> u, int root = 1) {
  if (visited[u.first][u.second]) return;
  visited[u.first][u.second] = 1;
  operations.push_back({u, 0});
  for (int i = 0; i < 4; i++) {
    int nx = u.first + dx[i];
    int ny = u.second + dy[i];
    if (nx >= 0 && nx < n && ny >= 0 && ny < m && mat[nx][ny] != '#')
      dfs({nx, ny}, 0);
  }
  if (root == 0) {
    operations.push_back({u, 2});
    operations.push_back({u, 1});
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> mat[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (visited[i][j] == 0 && mat[i][j] != '#') dfs({i, j}, 1);
  printf("%d\n", (int)operations.size());
  for (auto i : operations) {
    if (i.second == 0)
      printf("B ");
    else if (i.second == 1)
      printf("R ");
    else
      printf("D ");
    printf("%d %d\n", i.first.first + 1, i.first.second + 1);
  }
  return 0;
}
