#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9, dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
const long long llinf = 1e18;
int n, m;
char mp[505][505];
bool u[505][505];
vector<pair<char, pair<int, int> > > ans;
void dfs(int x, int y) {
  u[x][y] = true;
  for (int d = 0; d < 4; d++) {
    int xx = x + dx[d];
    int yy = y + dy[d];
    if (xx > 0 && xx <= n && yy > 0 && yy <= m && !u[xx][yy] &&
        mp[xx][yy] == '.') {
      ans.push_back(make_pair('B', make_pair(xx, yy)));
      dfs(xx, yy);
      ans.push_back(make_pair('D', make_pair(xx, yy)));
      ans.push_back(make_pair('R', make_pair(xx, yy)));
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> mp[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (!u[i][j] && mp[i][j] == '.')
        ans.push_back(make_pair('B', make_pair(i, j))), dfs(i, j);
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << ' ' << ans[i].second.first << ' '
         << ans[i].second.second << '\n';
  return 0;
}
