N,M=map(int,input().split()) seen=set() x,y=0,0 def F(): input() print("F") def B(): input() print("B") def L(): input() print("L") def R(): input() print("R") def solve(x,y): seen.add((x,y)) le=int(input()) if le and not (x+1,y) in seen: print("F") solve(x+1,y) B() L() le=int(input()) if le and not (x,y+1) in seen: print("F") solve(x,y+1) B() le=int(input()) if le and not (x-1,y) in seen: print("F") solve(x-1,y) B() le=int(input()) if le and not (x,y-1) in seen: print("F") solve(x,y-1) B()