#include <bits/stdc++.h>
using namespace std;
constexpr int N = 500 + 10;
int n, m;
char c[N][N];
bool mark[N][N];
queue<pair<char, pair<int, int>>> q;
void dfs(int x, int y, bool can) {
  if (c[x][y] == '#' || mark[x][y]) return;
  mark[x][y] = true;
  q.push({'B', {x, y}});
  dfs(x + 1, y, 1);
  dfs(x - 1, y, 1);
  dfs(x, y + 1, 1);
  dfs(x, y - 1, 1);
  if (can) {
    q.push({'D', {x, y}});
    q.push({'R', {x, y}});
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) c[0][i] = c[n + 1][i] = '#';
  for (int i = 1; i <= n; i++) c[i][0] = c[i][m + 1] = '#';
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> c[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) dfs(i, j, 0);
  cout << q.size() << '\n';
  while (!q.empty()) {
    cout << q.front().first << ' ' << q.front().second.first << ' '
         << q.front().second.second << '\n';
    q.pop();
  }
  return 0;
}
