import sys,random,bisect from collections import deque,defaultdict from heapq import heapify,heappop,heappush from itertools import permutations from math import gcd,log input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) def query(a,b): print("{} {}".format(a+1,b+1)) sys.stdout.flush() res = input() assert res!="-1" return res=="Black" N,M = mi() connect = [[False for j in range(N)] for i in range(N)] connect[0][0] = True stack = [(0,0)] move = [(-1,0),(0,-1),(1,0),(0,1)] while stack: h,w = stack.pop() for x,y in move: nx,ny = h+x,w+y if 0<=nx