#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int dy[] = {0, -1, 0, 1}; int dx[] = {-1, 0, 1, 0}; string f() { string s; cin >> s; if (s == "Merry") exit(0); return s; } void dfs(int y, int x, int k, vector >& vis) { vis[y][x] = true; f(); cout << 'L' << endl; k = (k + 3) % 4; if (f() != "0") { int _y = y + dy[k], _x = x + dx[k]; if (!vis[_y][_x]) { cout << 'F' << endl; dfs(_y, _x, k, vis); cout << 'B' << endl; f(); } } cout << 'R' << endl; k = (k + 1) % 4; if (f() != "0") { int _y = y + dy[k], _x = x + dx[k]; if (!vis[_y][_x]) { cout << 'F' << endl; dfs(_y, _x, k, vis); cout << 'B' << endl; f(); } } cout << 'R' << endl; k = (k + 1) % 4; if (f() != "0") { int _y = y + dy[k], _x = x + dx[k]; if (!vis[_y][_x]) { cout << 'F' << endl; dfs(_y, _x, k, vis); cout << 'B' << endl; f(); } } cout << 'L' << endl; k = (k + 3) % 4; f(); } int main() { vector > vis(50, vector(50)); for (;;) { dfs(25, 25, 0, vis); cout << 'R' << endl; f(); } }