#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 1;
int a[maxn][maxn], b[maxn][maxn], n, m;
bool mark[maxn][maxn];
vector<pair<char, pair<int, int> > > ans;
void dfs(int x, int y) {
  if (x < 1 || x > n || y < 1 || y > m || mark[x][y] || a[x][y]) return;
  mark[x][y] = 1;
  b[x][y] = 1;
  ans.push_back(make_pair('B', make_pair(x, y)));
  dfs(x + 1, y);
  dfs(x, y + 1);
  dfs(x - 1, y);
  dfs(x, y - 1);
  if (b[x + 1][y] == 1 || b[x - 1][y] == 1 || b[x][y + 1] == 1 ||
      b[x][y - 1] == 1) {
    b[x][y] = 2;
    ans.push_back(make_pair('D', make_pair(x, y)));
    ans.push_back(make_pair('R', make_pair(x, y)));
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      char x;
      cin >> x;
      if (x == '#') a[i][j] = 1;
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (!mark[i][j] && !a[i][j]) dfs(i, j);
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second.first << " "
         << ans[i].second.second << endl;
}
