#include <bits/stdc++.h>
using namespace std;
char arr[550][550];
int vis[550][550];
int x[4] = {0, 0, 1, -1};
int y[4] = {1, -1, 0, 0};
int n, m;
int dfs(int i, int j) {
  vis[i][j] = 1;
  printf("B %d %d\n", i + 1, j + 1);
  for (int k = 0; k < 4; k++)
    if (i + x[k] < n && i + x[k] >= 0)
      if (j + y[k] < m && j + y[k] >= 0)
        if (arr[i + x[k]][j + y[k]] == '.')
          if (!vis[i + x[k]][j + y[k]]) dfs(i + x[k], j + y[k]);
  printf("D %d %d\n", i + 1, j + 1);
  printf("R %d %d\n", i + 1, j + 1);
}
int c = 0;
int count(int i, int j) {
  vis[i][j] = 1;
  for (int k = 0; k < 4; k++)
    if (i + x[k] < n && i + x[k] >= 0)
      if (j + y[k] < m && j + y[k] >= 0)
        if (arr[i + x[k]][j + y[k]] == '.')
          if (!vis[i + x[k]][j + y[k]]) count(i + x[k], j + y[k]);
  c += 3;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", arr[i]);
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (!vis[i][j])
        if (arr[i][j] == '.') {
          c++;
          vis[i][j] = 1;
          for (int k = 0; k < 4; k++)
            if (i + x[k] < n && i + x[k] >= 0)
              if (j + y[k] < m && j + y[k] >= 0)
                if (!vis[i + x[k]][j + y[k]])
                  if (arr[i + x[k]][j + y[k]] == '.') count(i + x[k], j + y[k]);
        }
  printf("%d\n", c);
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (!vis[i][j])
        if (arr[i][j] == '.') {
          printf("B %d %d\n", i + 1, j + 1);
          vis[i][j] = 1;
          for (int k = 0; k < 4; k++)
            if (i + x[k] < n && i + x[k] >= 0)
              if (j + y[k] < m && j + y[k] >= 0)
                if (!vis[i + x[k]][j + y[k]])
                  if (arr[i + x[k]][j + y[k]] == '.') dfs(i + x[k], j + y[k]);
        }
  return 0;
}
