#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; //using namespace atcoder; #define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repr(i, 0, n) #define INF 2e9 #define MOD 1000000007 //#define MOD 998244353 #define LINF (long long)4e18 #define jck 3.141592 #define PI acos(-1.0) const double EPS = 1e-10; using ll = long long; using Pi = pair; using Pl = pair; //using mint = modint998244353; int dh[] = {1,0,-1,0}; int dw[] = {0,1,0,-1}; int main(){ int n,m; cin >> n >> m; queue q; q.push({2,1}); q.push({1,2}); vector> used(n,vector(n)); used[0][0] = true; used[0][1] = true; used[1][0] = true; m--; while(!q.empty()){ auto u = q.front(); int u1 = u.first; int u2 = u.second; if(u1 == n and u2 == n){ cout << "Yes" << endl; return 0; } q.pop(); if(2*n-u1-u2+1 > m) continue; cout << u1 << " " << u2 << endl; string t; cin >> t; if(t == "White") continue; m--; rep(i,2){ int nu1 = u1+dh[i]; int nu2 = u2+dw[i]; if(nu1 <= n and nu2 <= n){ if(used[nu1-1][nu2-1]) continue; used[nu1-1][nu2-1] = true; q.push({nu1,nu2}); } } } cout << "No" << endl; }