#include #include #include using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) const int dx[4] = {-1,0,1,0}; const int dy[4] = {0,1,0,-1}; int N,M; vector> visited; int main(){ cin >> N >> M; visited.assign(N+2,vector(N+2,0)); rep(i,N+2) visited[i][0] = visited[i][N+1] = 1; rep(i,N+2) visited[0][i] = visited[N+1][i] = 1; vector I; I.push_back(0); visited[1][1] = 0; rep(i,I.size()){ int p = I[i]; int x = p%N; int y = p/N; rep(d,4){ int nx = x+dx[d]; int ny = y+dy[d]; if(visited[ny+1][nx+1]) continue; visited[ny][nx] = 1; cout << nx << " " << ny << "\n" << flush; string res; cin >> res; if(res == "-1") exit(1); if(res == "White") continue; int ni = ny*N+nx; I.push_back(ni); } } if(visited[N][N] == 1) cout << "Yes\n"; else cout << "No\n"; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_inst;