#include <bits/stdc++.h> using namespace std; int n, m; bool all_explored; string command, feedback; char mapa[105][105]; void trying_so_hard_to_do_this_task() { string s1, s2, s3, s4; command = "LEFT"; cout << command << endl; cin >> s1; cout << command << endl; cin >> s2; cout << command << endl; cin >> s3; cout << command << endl; cin >> s4; if(s1 == "FAIL" && s2 == "FAIL" && s3 == "FAIL" && s4 == "FAIL") all_explored = true; } int main() { cout << "LEFT" << endl; cin >> feedback; if(feedback == "N") { cout << "3 3\n###\n#.#\n###" << endl; return 0; } while (true) { string feedback; trying_so_hard_to_do_this_task(); cout << command << endl; cin >> feedback; if (all_explored) { cout << "END" << endl; cout << n << " " << m << endl; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cout << mapa[i][j]; } cout << endl; } break; } else { continue; } } }