package yukicoder; import java.util.Scanner; public class Main{ public static void main(String[] args){ new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); //F,B,L,R int[][] map=new int[100][100]; int x=50;int y=50; int[] dx={1,0,-1,0}; int[] dy={0,1,0,-1}; int d=0; while(true){ int r=(int)(Math.random()*4); if(r==0){ if(map[y+dy[d%4]][x+dx[d%4]]!=-1) System.out.println("F"); }else if(r==1){ if(map[y+dy[(d+2)%4]][x+dx[(d+2)%4]]!=-1) System.out.println("B"); }else if(r==2){ System.out.println("L"); d++; }else if(r==3){ System.out.println("R"); d--; } String s=sc.nextLine(); if(s.equals("-1")){ map[y+dy[d%4]][x+dx[d%4]]=-1; }else if(r==0){ y=y+dy[d%4]; x=x+dx[d%4]; }else if(r==1){ y=y+dy[(d+2)%4]; x=x+dx[(d+2)%4]; } if(s.equals("Merry Christmas!")){ return; } } } }