#include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) {     if ((a == 0) || (b == 0)) return a + b;     return gcd(b, a % b);   }   long long pow_mod(long long a, long long b) {     long long res = 1;     while (b) {       if (b & 1) res = (res * a) % 1000000007;       a = (a * a) % 1000000007;       b >>= 1;     }     return res;   }   long long pow_2(long long a, long long b) {     long long res = 1;     while (b) {       if (b & 1) res = (res * a);       a = (a * a);       b >>= 1;     }     return res;   }   bool isPrime(long long a) {     for (int i = 3; (i * i) <= a; i += 2) {       if ((a % i) == 0) return false;     }     if ((a != 2) && ((a % 2) == 0)) return false;     return true;   }   string con_ll_to_str(int a) {     stringstream mystr;     mystr << a;     return mystr.str();   }   long long con_str_to_ll(string st) {     long long numb = 0;     int len = st.size(), i, j = 0;     for (i = len - 1; i >= 0; i--) {       numb += (pow_mod(10, j) * (st[i] -  0 ));       j++;     }     return numb;   }   long long baseno_to_decimal(string st, long long basee) {     long long i = 0, j, anss = 0;     for (j = (int)st.length() - 1; j >= 0; j--) {       anss += (st[j] -  0 ) * pow_2(basee, i);       i++;     }     return anss;   }   string decimal_to_string(long long num, long long basee) {     long long i = 0, j, opop;     string anss =   ;     vector<string> stri;     stri.push_back( 0 );     stri.push_back( 1 );     stri.push_back( 2 );     stri.push_back( 3 );     stri.push_back( 4 );     stri.push_back( 5 );     stri.push_back( 6 );     stri.push_back( 7 );     stri.push_back( 8 );     stri.push_back( 9 );     stri.push_back( A );     stri.push_back( B );     stri.push_back( C );     stri.push_back( D );     stri.push_back( E );     stri.push_back( F );     while (num) {       opop = num % basee;       anss += stri[opop];       num /= basee;     }     reverse(anss.begin(), anss.end());     return anss;   }   long long par[10010], dist[10010], N, M;   bool flag1, flag2;   pair<long long, long long> mapp[6];   map<string, string> ma;   vector<long long> vc[10010];   string st[110];   vector<long long> path_d;   struct comp {     bool operator()(pair<long long, long long> n1,                     pair<long long, long long> n2) {       return n1.second > n2.second;     }   };   void dijk(long long src) {     priority_queue<pair<long long, long long>,                    vector<pair<long long, long long> >, comp>         prqu;     prqu.push(make_pair(src, 0));     long long i, j, kk;     for (i = 0; i <= 10000; i++) {       dist[i] = INT_MAX;     }     memset(par, -1, sizeof(par));     dist[src] = 0;     while (!prqu.empty()) {       pair<long long, long long> xx = prqu.top();       prqu.pop();       for (kk = 0; kk <= (int)vc[xx.first].size() - 1; kk++) {         if (dist[vc[xx.first][kk]] > (xx.second + 1)) {           par[vc[xx.first][kk]] = xx.first;           dist[vc[xx.first][kk]] = xx.second + 1;           prqu.push(make_pair(vc[xx.first][kk], xx.second + 1));         }       }     }   }   void gr_cons(long long i, long long j, long long fi) {     if (i <= 0 || i > N || j <= 0 || j > M) {       return;     }     long long sec;     if (st[i][j] ==  .  || st[i][j] ==  F ) {       sec = ((i - 1) * M) + j;       vc[fi].push_back(sec);     }   }   string rev(string ch) {     if (ch ==  U  || ch ==  D ) {       if (ch ==  U ) return  D ;       return  U ;     }     if (ch ==  L  || ch ==  R ) {       if (ch ==  L ) return  R ;       return  L ;     }   }   void find_pos(long long i, long long j, pair<long long, long long> poss) {     if ((poss.first + 1) == i && j == poss.second) {       cout << ma[ D ] <<   n ;     } else if ((poss.first - 1) == i && j == poss.second) {       cout << ma[ U ] <<   n ;     } else if (poss.first == i && j == (poss.second - 1)) {       cout << ma[ L ] <<   n ;     } else {       cout << ma[ R ] <<   n ;     }   }   int main() {     long long i, j, fi, X, Y, o1;     cin >> N >> M;     for (i = 1; i <= N; i++) {       cin >> st[i];       st[i] =  #  + st[i];       st[0] = st[i];       st[N + 1] = st[i];     }     for (i = 0; i <= M; i++) {       st[0][i] =  . ;       st[i][0] =  . ;       st[i][M + 1] =  . ;       st[N + 1][i] =  . ;     }     for (i = 1; i <= N; i++) {       for (j = 1; j <= M; j++) {         if (st[i][j] ==  .  || st[i][j] ==  F ) {           fi = (i - 1) * M + j;           gr_cons(i - 1, j, fi);           gr_cons(i + 1, j, fi);           gr_cons(i, j - 1, fi);           gr_cons(i, j + 1, fi);         }         if (st[i][j] ==  F ) {           o1 = (i - 1) * M + j;         }       }     }     dijk(1);     while (o1 != -1) {       path_d.push_back(o1);       o1 = par[o1];     }     reverse(path_d.begin(), path_d.end());     pair<long long, long long> pos = make_pair(1, 1);     stack<string> stac;     if (st[pos.first + 1][pos.second] !=  *  &&         st[pos.first - 1][pos.second] !=  * ) {       flag1 = 1;       fflush(stdout);       cout <<  U             <<   n ;       fflush(stdout);       cin >> X >> Y;       if (st[X][Y] ==  F ) {         return 0;       }       if (X == (pos.first - 1) || X == pos.first) {         ma[ U ] =  U ;         ma[ D ] =  D ;       } else {         ma[ U ] =  D ;         ma[ D ] =  U ;       }       pos = make_pair(X, Y);     } else if (st[pos.first][pos.second + 1] !=  *  &&                st[pos.first][pos.second - 1] !=  * ) {       flag2 = 1;       fflush(stdout);       cout <<  R             <<   n ;       fflush(stdout);       cin >> X >> Y;       if (st[X][Y] ==  F ) {         return 0;       }       if (Y == (pos.second + 1)) {         ma[ L ] =  L ;         ma[ R ] =  R ;       } else {         ma[ L ] =  R ;         ma[ R ] =  L ;       }       pos = make_pair(X, Y);     }     if (flag1) {       if (pos != make_pair(1LL, 1LL)) {         fflush(stdout);         cout << rev( U ) <<   n ;         fflush(stdout);         cin >> X >> Y;       }       pos = make_pair(1, 1);       while (1) {         if (st[pos.first][pos.second + 1] !=  *  &&             st[pos.first][pos.second - 1] !=  * ) {           fflush(stdout);           cout <<  R                 <<   n ;           fflush(stdout);           cin >> X >> Y;           if (pos != make_pair(X, Y)) stac.push(rev( R ));           if (st[X][Y] ==  F ) {             return 0;           }           if (Y == (pos.second + 1)) {             ma[ L ] =  L ;             ma[ R ] =  R ;           } else {             ma[ L ] =  R ;             ma[ R ] =  L ;           }           pos = make_pair(X, Y);           break;         }         fflush(stdout);         cout << ma[ D ] <<   n ;         fflush(stdout);         cin >> X >> Y;         pos = make_pair(X, Y);         stac.push(rev(ma[ D ]));         if (st[X][Y] ==  F ) {           return 0;         }       }     } else {       if (pos != make_pair(1LL, 1LL)) {         fflush(stdout);         cout << rev( R ) <<   n ;         fflush(stdout);         cin >> X >> Y;       }       while (1) {         if (st[pos.first + 1][pos.second] !=  *  &&             st[pos.first - 1][pos.second] !=  * ) {           fflush(stdout);           cout <<  U                 <<   n ;           fflush(stdout);           cin >> X >> Y;           if (pos != make_pair(X, Y)) stac.push(rev( U ));           if (st[X][Y] ==  F ) {             return 0;           }           if (X == (pos.first - 1) || X == pos.first) {             ma[ U ] =  U ;             ma[ D ] =  D ;           } else {             ma[ U ] =  D ;             ma[ D ] =  U ;           }           pos = make_pair(X, Y);           break;         }         fflush(stdout);         cout << ma[ R ] <<   n ;         fflush(stdout);         cin >> X >> Y;         pos = make_pair(X, Y);         stac.push(rev(ma[ R ]));         if (st[X][Y] ==  F ) {           return 0;         }       }     }     if (pos != make_pair(1LL, 1LL)) {       while (stac.size()) {         fflush(stdout);         cout << stac.top() <<   n ;         fflush(stdout);         stac.pop();         cin >> X >> Y;       }     }     pos = make_pair(1, 1);     for (i = 1; i <= (int)path_d.size() - 1; i++) {       fflush(stdout);       if (!(path_d[i] % M)) {         find_pos(path_d[i] / M, M, pos);       } else {         find_pos((path_d[i] / M) + 1, (path_d[i] % M), pos);       }       fflush(stdout);       cin >> X >> Y;       pos = make_pair(X, Y);     }     return 0;   }