using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; n = c[0]; var map = new int[n][]; for (var i = 0; i < n; ++i) map[i] = new int[n]; map[0][0] = 1; map[n-1][n-1] = 1; WriteLine(DFS(0, 0, map) ? "Yes" : "No"); } static int n; static int[][] move = new int[][] { new int[] { -1, 0 }, new int[] { 1, 0 }, new int[] { 0, -1 }, new int[] { 0, 1 } }; static bool DFS(int i, int j, int[][] map) { if (i + 1 == n && j + 1 == n) return true; foreach (var m in move) { var ni = i + m[0]; var nj = j + m[1]; if (ni < 0 || ni >= n || nj < 0 || nj >= n) continue; if (map[ni][nj] == 0) { WriteLine($"{ni + 1} {nj + 1}"); var s = ReadLine(); if (s == "Black") map[ni][nj] = 1; else map[ni][nj] = 2; } if (map[ni][nj] == 1) { if (DFS(ni, nj, map)) return true; } } return false; } }