#include <bits/stdc++.h>
using namespace std;
const int N = 610;
int n, m;
char g[N][N];
bool vis[N][N];
int sx, sy;
vector<pair<char, pair<int, int> > > ans;
void dfs(int x, int y) {
  if (x < 0 || y < 0 || x >= n || y >= m) return;
  if (vis[x][y] || g[x][y] == '#') return;
  vis[x][y] = 1;
  ans.push_back(make_pair('B', make_pair(x, y)));
  dfs(x - 1, y);
  dfs(x + 1, y);
  dfs(x, y - 1);
  dfs(x, y + 1);
  if (x == sx && y == sy) return;
  ans.push_back(make_pair('D', make_pair(x, y)));
  ans.push_back(make_pair('R', make_pair(x, y)));
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", &g[i]);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (vis[i][j]) continue;
      if (g[i][j] == '#') continue;
      sx = i;
      sy = j;
      dfs(i, j);
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) {
    printf("%c %d %d\n", ans[i].first, ans[i].second.first + 1,
           ans[i].second.second + 1);
  }
  return 0;
}
