import java.util.*; public class Main { public static void main(String[] args) throws Exception{ final ContestScanner sc = new ContestScanner(); final ContestPrinter pr = new ContestPrinter(); final int N = sc.nextInt(); final int M = sc.nextInt(); int[][] board = new int[N][N]; //0: uncertain, 1:black, 2:white board[0][0] = 1; Queue> queue = new LinkedList<>(); queue.add(new Pair<>(0,0)); while(!queue.isEmpty()){ Pair top = queue.poll(); int h = top.getFirst(), w = top.getSecond(); if(h>0 && board[h-1][w]==0){ System.out.println(String.format("%d %d", h-1 + 1, w + 1)); if(sc.next().equals("Black")){ board[h-1][w] = 1; queue.add(new Pair<>(h-1,w)); } else{ board[h-1][w] = 2; } } if(h(h+1,w)); } else{ board[h+1][w] = 2; } } if(w>0 && board[h][w-1]==0){ System.out.println(String.format("%d %d", h + 1, w-1 + 1)); if(sc.next().equals("Black")){ board[h][w-1] = 1; queue.add(new Pair<>(h,w-1)); } else{ board[h][w-1] = 2; } } if(w(h,w+1)); } else{ board[h][w+1] = 2; } } } System.out.println(board[N-1][N-1]==1 ? "Yes" : "No"); } } class Pair, T extends Comparable> implements Comparable>{ S first; T second; public Pair(S s, T t){ first = s; second = t; } public S getFirst(){return first;} public T getSecond(){return second;} public boolean equals(Object another){ if(this==another) return true; if(!(another instanceof Pair)) return false; Pair otherPair = (Pair)another; return this.first.equals(otherPair.first) && this.second.equals(otherPair.second); } public int compareTo(Pair another){ java.util.Comparator> comp1 = java.util.Comparator.comparing(Pair::getFirst); java.util.Comparator> comp2 = comp1.thenComparing(Pair::getSecond); return comp2.compare(this, another); } public int hashCode(){ return first.hashCode() * 10007 + second.hashCode(); } public String toString(){ return String.format("(%s, %s)", first, second); } } class ContestScanner { private final java.io.InputStream in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private static final long LONG_MAX_TENTHS = 922337203685477580L; private static final int LONG_MAX_LAST_DIGIT = 7; private static final int LONG_MIN_LAST_DIGIT = 8; public ContestScanner(java.io.InputStream in){ this.in = in; } public ContestScanner(){ this(System.in); } private boolean hasNextByte() { if (ptr < buflen) { return true; }else{ ptr = 0; try { buflen = in.read(buffer); } catch (java.io.IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1; } private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126; } public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte(); } public String next() { if (!hasNext()) throw new java.util.NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while(isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new java.util.NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while (true) { if ('0' <= b && b <= '9') { int digit = b - '0'; if (n >= LONG_MAX_TENTHS) { if (n == LONG_MAX_TENTHS) { if (minus) { if (digit <= LONG_MIN_LAST_DIGIT) { n = -n * 10 - digit; b = readByte(); if (!isPrintableChar(b)) { return n; } else if (b < '0' || '9' < b) { throw new NumberFormatException( String.format("%d%s... is not number", n, Character.toString(b)) ); } } } else { if (digit <= LONG_MAX_LAST_DIGIT) { n = n * 10 + digit; b = readByte(); if (!isPrintableChar(b)) { return n; } else if (b < '0' || '9' < b) { throw new NumberFormatException( String.format("%d%s... is not number", n, Character.toString(b)) ); } } } } throw new ArithmeticException( String.format("%s%d%d... overflows long.", minus ? "-" : "", n, digit) ); } n = n * 10 + digit; }else if(b == -1 || !isPrintableChar(b)){ return minus ? -n : n; }else{ throw new NumberFormatException(); } b = readByte(); } } public int nextInt() { long nl = nextLong(); if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next()); } public long[] nextLongArray(int length){ long[] array = new long[length]; for(int i=0; i