#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))

#define MAX 525

int h,w;
char mp[MAX][MAX];

const int begx = MAX, begy = MAX;
int walk[2*MAX][2*MAX];
const int LAND = 1;
const int SEA = 0;
const int UNKO = -1;

int used[MAX][MAX];

// local test
const bool LOCAL = false;
int locbegx, locbegy;
int locx, locy;

char dc[] = {'U', 'R', 'D', 'L'};
int dx[] = {0,1,0,-1};
int dy[] = {-1,0,1,0};

int querytime = 350000;
char buf[10];
int x,y;
bool query(int dir){
  int ny = y + dy[dir];
  int nx = x + dx[dir];
  if(walk[ny][nx]==SEA)return false;
  querytime--;
  if(!LOCAL){
    printf("? %c\n", dc[dir]);
    fflush(stdout);
    scanf("%s",buf);
    if(buf[0]=='Y'){
      walk[ny][nx] = LAND;
      y = ny;
      x = nx;
      return true;
    }else{
      walk[ny][nx] = SEA;
      return false;
    }
  }else{
    int nly = locy + dy[dir];
    int nlx = locx + dx[dir];
    if(mp[nly][nlx]=='#'){
      locy = nly;
      locx = nlx;
      walk[ny][nx] = LAND;
      y = ny;
      x = nx;
      return true;
    }else{
      walk[ny][nx] = SEA;
      return false;
    }
  }
}
bool answer(int y, int x){
  if(!LOCAL){
    printf("! %d %d\n", y,x);
    fflush(stdout);
    return true;
  }else{
    if(locbegx == x && locbegy == y){
      puts("OK");
      return true;
    }else{
      puts("NG");
      return false;
    }
  }
}


typedef pair<int,int> pii;

void dfs(int y, int x){
  stack<pii> S;
  S.push(pii(y,x));
  while(S.size()){
    y = S.top().first;
    x = S.top().second; S.pop();
    walk[y][x] = SEA;
    REP(d,4){
      int ny = y+dy[d];
      int nx = x+dx[d];
      if(ny<0 || nx<0 || ny>=2*MAX || nx>=2*MAX)continue;
      if(walk[ny][nx]!=UNKO)continue;
      S.push(pii(ny,nx));
      walk[ny][nx] = SEA;
    }
  }
}
int l,r,u,d;
int dfs2(int y, int x){
  stack<pii> S;
  S.push(pii(y,x));
  int ret = 0;
  while(S.size()){
    y = S.top().first;
    x = S.top().second; S.pop();
    ret++;
    used[y][x] = 1;
    CHMIN(l,x); CHMAX(r,x);
    CHMIN(u,y); CHMAX(d,y);
    REP(d,4){
      int ny = y+dy[d];
      int nx = x+dx[d];
      if(ny<0 || nx<0 || ny>=h || nx>=w)continue;
      if(used[ny][nx] != 0)continue;
      if(mp[ny][nx] != '#')continue;
      S.push(pii(ny,nx));
      used[ny][nx] = 1;
    }
  }
  return ret;
}
int miny=1252, minx=1252, maxy=-1252, maxx=-1252;
bool dfs3(int y, int x){
  stack<pii> S;
  S.push(pii(y,x));
  while(S.size()){
    y = S.top().first;
    x = S.top().second; S.pop();
    if(walk[miny+y-u][minx+x-l]!=LAND)return false;
    used[y][x] = 2;
    REP(d,4){
      int ny = y+dy[d];
      int nx = x+dx[d];
      if(ny<0 || nx<0 || ny>=h || nx>=w)continue;
      if(used[ny][nx] != 1)continue;
      S.push(pii(ny,nx));
      used[ny][nx] = 2;
    }
  }
  return true;
}

int main(){
  if(false){
    h = w = 500;
    REP(i,h)REP(j,w)mp[i][j]='.';
    int y = 1, x = 1;
    mp[y][x] = '#';
    REP(_,500){
      while(y+2<h && mp[y+2][x]!='#'){
        y++;mp[y][x]='#';
      }
      while(x+2<w && mp[y][x+2]!='#'){
        x++;mp[y][x]='#';
      }
      while(y-2>=0 && mp[y-2][x]!='#'){
        y--;mp[y][x]='#';
      }
      while(x-2>=0 && mp[y][x-2]!='#'){
        x--;mp[y][x]='#';
      }
    }
    printf("%d %d\n",h,w);
    REP(i,h)puts(mp[i]);
    return 0;
  }
  if(true){
    scanf("%d%d",&h,&w);
    REP(i,h)scanf("%s",mp[i]);
  }else{
    srand(time(NULL));
    h = 20;
    w = 20;
    REP(i,h)REP(j,w){
      mp[i][j] = (rand()%2==0 ? '.' : '#');
    }
    REP(i,h)mp[i][0] = mp[i][w-1] = '.';
    REP(j,w)mp[0][j] = mp[h-1][j] = '.';
    REP(i,h)puts(mp[i]);
  }
  if(LOCAL){
    while(true){
      locbegy = rand() % h;
      locbegx = rand() % w;
      if(mp[locbegy][locbegx]=='#'){
        locy = locbegy;
        locx = locbegx;
        break;
      }
    }
  }
  y = begy;
  x = begx;
  REP(i,2*MAX)REP(j,2*MAX)walk[i][j] = UNKO;
  walk[y][x] = LAND;
  // go to right
  while(query(1));
  int curd = 0;
  int stopping = 0;
  while(querytime>0){
    if(query((curd+1)%4)){
      curd = (curd+1)%4;
      stopping = 0;
      continue;
    }
    if(querytime<=0)break;
    if(!query(curd)){
      curd = (curd+3)%4;
      stopping++;
    }else{
      stopping = 0;
    }
    if(stopping >= 10)break;
  }
  REP(i,2*MAX)REP(j,2*MAX)if(walk[i][j]==SEA){
    walk[i][j] = UNKO;
  }
  dfs(0,0);
  int anscnt = 0;
  REP(i,2*MAX)REP(j,2*MAX)if(walk[i][j]==LAND){
    CHMIN(miny, i); CHMAX(maxy, i);
    CHMIN(minx, j); CHMAX(maxx, j);
    anscnt++;
  }else if(walk[i][j]==UNKO){
    walk[i][j] = LAND;
    anscnt++;
  }

  REP(i,h)REP(j,w)if(mp[i][j]=='#' && used[i][j]==0){
    l=u=1252;
    r=d=-1252;
    int cnt = dfs2(i,j);
    if(anscnt != cnt)continue;
    bool ok = dfs3(i,j);
    if(!ok)continue;
    int ansy = u + (begy - miny);
    int ansx = l + (begx - minx);
    answer(ansy, ansx);
    return 0;
  }
  answer(0,0);
  return 0;
}



Measured memory_bytes: 12204