#include #include using namespace std; int par[200010],sz[200010]; void init(int n){ for(int i=0;isz[y]) swap(x,y); par[x] = y; sz[y] += sz[x]; } bool same(int x, int y){ return find(x)==find(y); } int query(int a,int b){ cout << a + 1 << " " << b + 1 << endl; string t; cin >> t; if(t[0]=='B') return 1; else return 0; } bool used[1010][1010]; int mp[1010][1010]; void dfs(int x,int y,int n){ if(used[x][y]) return; used[x][y] = true; int z = query(x,y); mp[x][y] = z; if(!mp[x][y]) return; if(x + 1=0) dfs(x - 1,y,n); if(y + 1=0) dfs(x,y - 1,n); } int main(){ int i,j,n,m; cin >> n >> m; for(i=0;i