#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, 0, -1};
int dy[] = {0, 1, -1, 0};
const int MAX = 510;
char arr[MAX][MAX];
bool vis[MAX][MAX];
vector<pair<pair<int, int>, int> > ans;
int n, m;
bool check(int x, int y) {
  return x >= 0 && x < n && y >= 0 && y < m && !vis[x][y] && arr[x][y] != '#';
}
void dfs(int x, int y, int root) {
  vis[x][y] = 1;
  ans.push_back({{x + 1, y + 1}, 1});
  for (int i = 0; i < 4; ++i) {
    int xx = x + dx[i];
    int yy = y + dy[i];
    if (check(xx, yy)) dfs(xx, yy, 1);
  }
  if (root) {
    ans.push_back({{x + 1, y + 1}, 3});
    ans.push_back({{x + 1, y + 1}, 2});
  }
}
int main() {
  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 (!vis[i][j] && arr[i][j] != '#') dfs(i, j, 0);
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); ++i) {
    if (ans[i].second == 1)
      cout << "B " << ans[i].first.first << " " << ans[i].first.second << "\n";
    else if (ans[i].second == 2)
      cout << "R " << ans[i].first.first << " " << ans[i].first.second << "\n";
    else
      cout << "D " << ans[i].first.first << " " << ans[i].first.second << "\n";
  }
  return 0;
}
