#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500;
const int dr[] = {0, 1, 0, -1};
const int dc[] = {1, 0, -1, 0};
bool vis[MAXN + 5][MAXN + 5];
char grid[MAXN + 5][MAXN + 5];
int W, H;
vector<pair<char, pair<int, int> > > ans;
inline void put(char ch, int i, int j) {
  ans.push_back(make_pair(ch, make_pair(i, j)));
}
void buildRed(int i, int j) {
  if (i < 0 || j < 0 || i >= H || j >= W) return;
  if (grid[i][j] == '#') return;
  if (vis[i][j]) return;
  vis[i][j] = true;
  for (int dir = 0; dir < 4; dir++) buildRed(i + dr[dir], j + dc[dir]);
  put('D', i + 1, j + 1);
  put('R', i + 1, j + 1);
  return;
}
int main() {
  int c, c2;
  scanf("%d%d", &H, &W);
  for (c = 0; c < H; c++) scanf("%s", grid[c]);
  for (c = 0; c < H; c++)
    for (c2 = 0; c2 < W; c2++)
      if (grid[c][c2] == '.') put('B', c + 1, c2 + 1);
  for (c = 0; c < H; c++)
    for (c2 = 0; c2 < W; c2++)
      if (!vis[c][c2] && grid[c][c2] == '.') {
        vis[c][c2] = true;
        for (int dir = 0; dir < 4; dir++) buildRed(c + dr[dir], c2 + dc[dir]);
      }
  printf("%d\n", ans.size());
  for (c = 0; c < ans.size(); c++)
    printf("%c %d %d\n", ans[c].first, ans[c].second.first,
           ans[c].second.second);
  return 0;
}
