func_code_string: #include <bits/stdc++.h>   using namespace std;   char table[500 + 10][500 + 10];   int vis[500 + 10][500 + 10];   int n, m;   int dirr[4] = {1, -1, 0, 0};   int dirc[4] = {0, 0, 1, -1};   vector<tuple<int, int, int> > ans;   int dfs(int i, int j, int depth) {     if (i < 0 || i >= n || j < 0 || j >= m) return 0;     if (vis[i][j] || table[i][j] ==  # ) return 0;     vis[i][j] = 1;     ans.push_back(make_tuple(0, i + 1, j + 1));     for (int d = 0; d < 4; d++) {       dfs(i + dirr[d], j + dirc[d], depth + 1);     }     if (depth > 0) {       ans.push_back(make_tuple(1, i + 1, j + 1));       ans.push_back(make_tuple(2, i + 1, j + 1));     }     return 0;   }   int main() {     cin >> n >> m;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         cin >> table[i][j];       }     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (table[i][j] ==  # ) continue;         if (vis[i][j] == 0) {           dfs(i, j, 0);         }       }     }     printf( %d n , ans.size());     int a, b, c;     for (tuple<int, int, int> t : ans) {       tie(a, b, c) = t;       if (a == 0) {         printf( B %d %d n , b, c);       } else if (a == 1) {         printf( D %d %d n , b, c);       } else {         printf( R %d %d n , b, c);       }     }     return 0;   }   