#include <bits/stdc++.h>
using namespace std;
const int MAXn = 500 + 100;
string s[MAXn];
vector<int> ans[3];
bool mark[MAXn][MAXn];
int n, m;
void dfs(int i, int j, int beg_x, int beg_y) {
  mark[i][j] = true;
  ans[0].push_back(0);
  ans[1].push_back(i);
  ans[2].push_back(j);
  if (i > 0)
    if (!mark[i - 1][j])
      if (s[i - 1][j] == '.') dfs(i - 1, j, i, j);
  if (j > 0)
    if (!mark[i][j - 1])
      if (s[i][j - 1] == '.') dfs(i, j - 1, i, j);
  if (i + 1 < n)
    if (!mark[i + 1][j])
      if (s[i + 1][j] == '.') dfs(i + 1, j, i, j);
  if (j + 1 < m)
    if (!mark[i][j + 1])
      if (s[i][j + 1] == '.') dfs(i, j + 1, i, j);
  if (i != beg_x || j != beg_y) {
    ans[0].push_back(2), ans[1].push_back(i), ans[2].push_back(j);
    ans[0].push_back(1), ans[1].push_back(i), ans[2].push_back(j);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> s[i];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (!mark[i][j])
        if (s[i][j] == '.') dfs(i, j, i, j);
  cout << ans[0].size() << endl;
  for (int i = 0; i < ans[0].size(); ++i) {
    if (ans[0][i] == 0)
      cout << "B"
           << " ";
    if (ans[0][i] == 1)
      cout << "R"
           << " ";
    if (ans[0][i] == 2)
      cout << "D"
           << " ";
    cout << ans[1][i] + 1 << " " << ans[2][i] + 1 << endl;
  }
}
