#include using namespace std; vector dx = {1, 0, -1, 0}; vector dy = {0, 1, 0, -1}; void dfs(vector> &S, int x, int y){ int N = S.size(); for (int i = 0; i < 4; i++){ int x2 = x + dx[i]; int y2 = y + dy[i]; if (0 <= x2 && x2 < N && 0 <= y2 && y2 < N){ if (S[x2][y2] == -1){ cout << x2 + 1 << ' ' << y2 + 1 << endl; string s; cin >> s; if (s == "White"){ S[x2][y2] = 0; } if (s == "Black"){ S[x2][y2] = 1; dfs(S, x2, y2); } } } } } int main(){ int N, M; cin >> N >> M; vector> S(N, vector(N, -1)); S[0][0] = 1; dfs(S, 0, 0); if (S[N - 1][N - 1] == 1){ cout << "Yes" << endl; } else { cout << "No" << endl; } }