#include <bits/stdc++.h>
using namespace std;
const double eps(1e-8);
char maz[600][600];
int n, m;
bool vis[600][600];
queue<pair<int, int> > Q;
vector<pair<int, int> > pos;
vector<char> op;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
void dfs(int x, int y) {
  op.push_back('B');
  pos.push_back(make_pair(x, y));
  for (int i = 0; i < 4; i++) {
    int tx = x + dx[i], ty = y + dy[i];
    if (tx < 0 || tx >= n || ty < 0 || ty >= m || maz[tx][ty] == '#') continue;
    if (!vis[tx][ty]) {
      vis[tx][ty] = 1;
      dfs(tx, ty);
      op.push_back('D');
      pos.push_back(make_pair(tx, ty));
      op.push_back('R');
      pos.push_back(make_pair(tx, ty));
    }
  }
  return;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", maz[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (maz[i][j] == '.' && !vis[i][j]) vis[i][j] = 1, dfs(i, j);
  printf("%d\n", (int)pos.size());
  for (unsigned int i = 0; i < pos.size(); i++)
    printf("%c %d %d\n", op[i], pos[i].first + 1, pos[i].second + 1);
  return 0;
}
