import sys N = 50 flush = sys.stdout.flush used = [[0]*N for i in xrange(N)] dx = [-1, 0, 1, 0] dy = [0, -1, 0, 1] # (x, y, dir) st = [[0, 0, 0, 4]] used[0][0] = 1 while 1: s = raw_input() if s[0]=="M": exit(0) d = int(s) if d == 20151124: print"F" flush() continue x, y, di, f = el = st[-1] nx = x + dx[di]; ny = y + dy[di] if d and not used[ny][nx]: print"F"; flush() st.append([nx, ny, di, 4]) used[ny][nx] = 1 else: if f==0: print "B"; flush() st.pop() else: el[2] = (di + 1) % 4 el[3] = f-1 print"R"; flush()