import sys sys.setrecursionlimit(10 ** 6) from bisect import * from collections import * from heapq import * def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def SI(): return sys.stdin.readline()[:-1] def LLI(rows_number): return [LI() for _ in range(rows_number)] int1 = lambda x: int(x) - 1 def MI1(): return map(int1, sys.stdin.readline().split()) def LI1(): return list(map(int1, sys.stdin.readline().split())) p2D = lambda x: print(*x, sep="\n") dij = [(1, 0), (0, 1), (-1, 0), (0, -1)] def main(): # 0まだ 1済み m = [[0] * 60 for _ in range(60)] i = j = 30 m[i][j]=1 d = 0 log = [] def check(ret): if ret == "0": di, dj = dij[d] m[i + di][j + dj] = 1 while ret == "20151224": print("F", flush=True) ret = input() if ret == "Merry Christmas!": exit() def F(i, j): print("F", flush=True) ret = input() check(ret) di, dj = dij[d] i, j = i + di, j + dj m[i][j] = 1 return ret,i,j def B(i, j): print("B", flush=True) ret = input() check(ret) di, dj = dij[d] i, j = i - di, j - dj return ret,i,j def R(d): print("R", flush=True) ret = input() check(ret) d = (d - 1) % 4 return ret, d def L(d): print("L", flush=True) ret = input() check(ret) d = (d + 1) % 4 return ret, d ret = input() check(ret) while 1: # 直進できるだけする di,dj=dij[d] while ret != "0" and m[i+di][j+dj]==0: ret, i, j = F(i, j) log.append(0) # まだ行っていなければ右を向く di, dj = dij[(d - 1) % 4] if m[i + di][j + dj] == 0: ret, d = R(d) log.append(-1) continue # 右がダメなら左 di, dj = dij[(d + 1) % 4] if m[i + di][j + dj] == 0: ret, d = L(d) log.append(1) continue # それもだめなら戻る noback=True while log[-1]!=0 or noback: dir=log.pop() if dir==1:ret,d=R(d) elif dir==-1:ret,d=L(d) else: ret, i, j = B(i, j) noback=False main()