#include <bits/stdc++.h>
using namespace std;
int n, m, vis[505][505], cur;
vector<pair<char, pair<int, int>>> res(1000005);
vector<vector<int>> v(250005);
vector<string> st;
void dfs(int i, int j) {
  vis[i][j] = 1;
  res[cur++] = {'B', {i, j}};
  if (i > 0 && vis[i - 1][j] == 0 && st[i - 1][j] == '.') {
    v[i * m + j].push_back((i - 1) * m + j);
    dfs(i - 1, j);
  }
  if (i < n - 1 && vis[i + 1][j] == 0 && st[i + 1][j] == '.') {
    v[i * m + j].push_back((i + 1) * m + j);
    dfs(i + 1, j);
  }
  if (j > 0 && vis[i][j - 1] == 0 && st[i][j - 1] == '.') {
    v[i * m + j].push_back(i * m + j - 1);
    dfs(i, j - 1);
  }
  if (j < m - 1 && vis[i][j + 1] == 0 && st[i][j + 1] == '.') {
    v[i * m + j].push_back(i * m + j + 1);
    dfs(i, j + 1);
  }
}
void func(int i, int p) {
  for (int j = 0; j < int(v[i].size()); j++) func(v[i][j], i);
  if (i != p) {
    res[cur++] = {'D', {i / m, i % m}};
    res[cur++] = {'R', {i / m, i % m}};
  }
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    st.push_back(s);
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (!vis[i][j] && st[i][j] == '.') {
        dfs(i, j);
        func(i * m + j, i * m + j);
      }
  cout << cur << "\n";
  for (int i = 0; i < cur; i++)
    cout << res[i].first << " " << res[i].second.first + 1 << " "
         << res[i].second.second + 1 << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int qc = 1;
  for (int i = 1; i <= qc; i++) solve();
}
