#include<bits/stdc++.h> using namespace std; int mp[111][111]; bool all_explored(){ bool flag = true; for (int i = 1; i <= 100; i ++){ for (int j = 1; j <= 100; j ++){ if (mp[i][j] == 0) flag = false; } } return flag; } int main(){ int posx=50, posy=50; int dir = 0; // unknown cout << "LEFT" << endl ; while (true) { string feedback; cin >> feedback; if (all_explored()) { cout << "END" << endl; cout << 100 << " " << 100 << endl; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { cout << (mp[i][j]); } cout << endl; } break; } else { if (feedback == "N"){ dir=1; // posy --; } else if (feedback == "S"){ dir=2; // posy ++; } else if (feedback == "W"){ dir=3; // posx --; } else if (feedback == "E"){ dir=4; // posx ++; } if (feedback.size() == 1 and posx >= 1 and posx <= 100 and posy>= 1 and posy <= 100){ cout << "GO" << endl; } else if (feedback.size() == 1) cout << "LEFT" << endl; if (feedback == "SUCC"){ mp[posx][posy] = 1; cout << "GO" << endl; } else if (feedback == "FAIL"){ mp[posx][posy] = 2; cout << "LEFT" << endl; } } } return 0; }