#include <bits/stdc++.h>
using namespace std;
const int N = 5e2 + 50;
int n, m, num;
int ans[3][1000000];
char arr[N][N];
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
void dfs(int x, int y) {
  ans[0][num] = 'B';
  ans[1][num] = x + 1;
  ans[2][num] = y + 1;
  num++;
  arr[x][y] = 'B';
  for (int i = 0; i < 4; i++) {
    int x2 = x + dx[i], y2 = y + dy[i];
    if (x2 < 0 || x2 >= n || y2 < 0 || y2 >= m) continue;
    if (arr[x2][y2] == '.') {
      dfs(x2, y2);
      ans[0][num] = 'D';
      ans[1][num] = x2 + 1;
      ans[2][num] = y2 + 1;
      num++;
      ans[0][num] = 'R';
      ans[1][num] = x2 + 1;
      ans[2][num] = y2 + 1;
      num++;
      arr[x][y] = 'R';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> arr[i][j];
    }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (arr[i][j] == '.') dfs(i, j);
    }
  }
  cout << num << '\n';
  for (int i = 0; i < num; i++) {
    cout << (char)ans[0][i] << " " << ans[1][i] << " " << ans[2][i] << "\n";
  }
  return 0;
}
