#include <bits/stdc++.h>
using namespace std;
const int MX = 510;
const long long INF = (1ll << 60);
const int inf = (1 << 30);
const long long mod = 1e9 + 7;
int n, m, c;
char a[MX][MX];
vector<pair<int, int> > v[MX * MX];
bool vis[MX][MX];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
vector<pair<char, pair<int, int> > > ans;
void dfs(int x, int y, int x1, int y1) {
  if (vis[x][y]) return;
  vis[x][y] = 1;
  v[c].push_back({x, y});
  ans.push_back({'B', {x + 1, y + 1}});
  for (int i = 0; i < 4; i++) {
    int nx = x + dx[i], ny = y + dy[i];
    if (vis[nx][ny] || nx >= n || nx < 0 || ny >= m || ny < 0 ||
        a[nx][ny] == '#')
      continue;
    dfs(nx, ny, x1, y1);
  }
  if (x == x1 && y == y1) return;
  ans.push_back({'D', {x + 1, y + 1}});
  ans.push_back({'R', {x + 1, y + 1}});
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", &a[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (vis[i][j] || a[i][j] == '#') continue;
      dfs(i, j, i, j);
      ++c;
    }
  }
  cout << ans.size() << endl;
  for (auto pp : ans) {
    printf("%c %d %d\n", pp.first, pp.second.first, pp.second.second);
  }
}
