#include <bits/stdc++.h>
using namespace std;
char grid[510][510];
int totalComps = 0;
bool visited[510][510];
int dx[] = {1, 0, 0, -1};
int dy[] = {0, 1, -1, 0};
bool inserted[510][510];
int N, M;
vector<pair<int, pair<int, int> > > ans;
bool check(int x, int y) {
  if (x >= 0 && x < N && y >= 0 && y < M) return true;
  return false;
}
void dfs(int nodex, int nodey) {
  int headx = nodex;
  int heady = nodey;
  totalComps++;
  stack<pair<int, int> > st;
  st.push(pair<int, int>(nodex, nodey));
  inserted[nodex][nodey] = true;
  while (!st.empty()) {
    nodex = st.top().first;
    nodey = st.top().second;
    if (!visited[nodex][nodey]) {
      visited[nodex][nodey] = true;
      ans.push_back(
          pair<int, pair<int, int> >(1, pair<int, int>(nodex, nodey)));
      for (int i = 0; i < 4; i++) {
        int x = nodex + dx[i], y = nodey + dy[i];
        if (check(x, y) && !visited[x][y] && grid[x][y] == '.' &&
            !inserted[x][y]) {
          st.push(pair<int, int>(x, y));
          inserted[x][y] = true;
        }
      }
    } else {
      st.pop();
      if (nodex == headx && nodey == heady) continue;
      ;
      ans.push_back(
          pair<int, pair<int, int> >(2, pair<int, int>(nodex, nodey)));
      ans.push_back(
          pair<int, pair<int, int> >(3, pair<int, int>(nodex, nodey)));
    }
  }
}
inline void ReadInput(void) {
  scanf("%d", &N);
  scanf("%d", &M);
  for (int i = 0; i < N; i++) {
    scanf("%s", &grid[i]);
  }
}
inline void solve(void) {
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (grid[i][j] == '.' and !visited[i][j]) {
        dfs(i, j);
      }
    }
  }
  cout << ((int)ans.size()) << endl;
  for (int i = 0; i < ans.size(); i++) {
    int type, a, b;
    type = ans[i].first;
    a = ans[i].second.first;
    b = ans[i].second.second;
    if (type == 1) {
      printf("B %d %d\n", a + 1, b + 1);
    } else if (type == 2) {
      printf("D %d %d\n", a + 1, b + 1);
    } else if (type == 3) {
      printf("R %d %d\n", a + 1, b + 1);
    }
  }
}
inline void Refresh(void) {
  for (int i = 0; i < 510; i++) {
    for (int j = 0; j < 510; j++) visited[i][j] = inserted[i][j] = false;
  }
}
int main() {
  Refresh();
  ReadInput();
  solve();
  return 0;
}
