#include #include #include #include //#include #include #include #include #include #include //#include #include #include #include //#include #include #include //#include #include #include #include #include const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; using namespace std; typedef long long ll; typedef vector vi; typedef vector vll; typedef pair pii; bool visit[50][50]; const int B = 25; int dir = 0; void dfs(int y, int x) { visit[y][x] = true; int odir = dir; string s; for (int k = 0; k < 4; k++) { cout << "L" << endl; dir = (dir+1)%4; int f; cin >> f; if (f != 0) { if (f == 20151224) { s = "1"; while (isdigit(s[0])) { cout << "F" << endl; cin >> s; } exit(0); } int ny = y+dy[(odir+k)%4]; int nx = x+dx[(odir+k)%4]; if (visit[ny+B][nx+B]) continue; cout << "F" << endl; cin >> s; dfs(ny, nx); while (dir != (odir+k)%4) { cout << "L" << endl; cin >> s; dir = (dir+1)%4; } } } while (dir != (odir+2)%4) { cout << "L" << endl; dir = (dir+1)%4; cin >> s; } } int main() { dfs(0, 0); return 0; }