++$d,print"L "while<><++$|||$m{$y=($x+30**($d&=3))%901}&&$m{$y}^$d^6;$m{$x}=$d^4;$x=$y;--$d;print"F R ";do$0.<>=~/M/