func_code_string: #include <bits/stdc++.h>   using namespace std;   char grid[105][105];   int dix[] = {-1, 1, 0, 0}, diy[] = {0, 0, -1, 1}, par[105][105], col[105][105],       n, m;   char ddd[] =  UDLR ;   vector<int> vec;   void dfs(int xx, int yy) {     int i, p, q;     col[xx][yy] = 1;     for (i = 0; i < 4; i++) {       p = xx + dix[i];       q = yy + diy[i];       if (p >= 0 && p < n && q >= 0 && q < m && grid[p][q] !=  *  && !col[p][q]) {         par[p][q] = i;         dfs(p, q);       }     }     return;   }   int main() {     int i, j, k, p, q, x, y;     scanf( %d %d , &n, &m);     for (i = 0; i < n; i++) scanf( %s , grid[i]);     for (i = 0; i < n; i++) {       for (j = 0; j < m; j++) {         if (grid[i][j] ==  F ) p = i, q = j;       }     }     dfs(0, 0);     while (p || q) {       vec.push_back(par[p][q]);       y = par[p][q];       p -= dix[y], q -= diy[y];     }     reverse(vec.begin(), vec.end());     for (i = 0; i < vec.size(); i++) {       printf( %c n , ddd[vec[i]]);       fflush(stdout);       scanf( %d %d , &x, &y);       x--, y--;       if (p == x && q == y) {         swap(ddd[vec[i]], ddd[vec[i] - 1]);         i--;       }       p = x, q = y;     }     return 0;   }   