import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { int r; auto rs = readln.chomp.to!int; foreach (i; 0..rs) r = ask("F"); for (;;) { if (r == 0) { r = ask("R"); continue; } ask("F"); r = ask("L"); } } int ask(string c) { import core.stdc.stdlib; writeln(c); stdout.flush(); auto s = readln.chomp; if (s == "Merry Christmas!") exit(0); auto r = s.to!int; if (r == 20151224) ask("F"); return r; }