#include<bits/stdc++.h> using namespace std; char q; int minx = 102 , maxx = 102 , miny = 102 , maxy = 102; int s(bool u){ if(u == 'N'){ return 1; } if(u == 'E'){ return 2; } if(u == 'S'){ return 3; } return 4; } int fxx[5] = {0 , -1 , 0 , 0 , 1} , fxy[5] = {0 , 0 , -1 , 1 , 0}; int fs = 1; char mapp[205][205]; int map1[205][205]; void dfs(int x , int y){ minx = min(minx , x); miny = min(miny , y); maxx = max(maxx , x); maxy = max(maxy , y); if(map1[x][y] == 1){ return; } map1[x][y] = 1; mapp[102][102] = '.'; string u; char v; cout << "GO" << '\n'; cin >> u; if(u == "SUCC"){ dfs(x + fxx[fs] , y + fxy[fs]); } else{ minx = min(minx , x + fxx[fs]); maxx = max(maxx , x + fxx[fs]); miny = min(miny , y + fxy[fs]); maxy = max(maxy , y + fxy[fs]); } cout << "RIGHT" << '\n'; cin >> v; fs = fs % 4 + 1; cout << "GO" << '\n'; cin >> u; if(u == "SUCC"){ dfs(x + fxx[fs] , y + fxy[fs]); } else{ minx = min(minx , x + fxx[fs]); maxx = max(maxx , x + fxx[fs]); miny = min(miny , y + fxy[fs]); maxy = max(maxy , y + fxy[fs]); } cout << "RIGHT" << '\n'; cin >> v; fs = fs % 4 + 1; cout << "GO" << '\n'; cin >> u; if(u == "SUCC"){ dfs(x + fxx[fs] , y + fxy[fs]); } else{ minx = min(minx , x + fxx[fs]); maxx = max(maxx , x + fxx[fs]); miny = min(miny , y + fxy[fs]); maxy = max(maxy , y + fxy[fs]); } cout << "RIGHT" << '\n'; cin >> v; fs = fs % 4 + 1; cout << "GO" << '\n'; cin >> u; if(u == "SUCC"){ dfs(x + fxx[fs] , y + fxy[fs]); } else{ minx = min(minx , x + fxx[fs]); maxx = max(maxx , x + fxx[fs]); miny = min(miny , y + fxy[fs]); maxy = max(maxy , y + fxy[fs]); } cout << "RIGHT"; cin >> v; cout << "RIGHT"; cin >> v; cout << "RIGHT"; cin >> v; cout << "GO"; cin >> u; } int main(){ memset(mapp , '#' , sizeof(mapp)); //map[102][102] = '.'; cout << "LEFT" << '\n'; cin >> q; cout << "RIGHT" << '\n'; cin >> q; fs = s(q); dfs(102 , 102); int n = maxx - minx + 1 , m = maxy - miny + 1; cout << n << ' ' << m << endl; for(int i = minx ; i <= maxx ; i ++){ for(int j = miny ; j <= maxy ; j ++){ cout << mapp[i][j]; } cout << endl; } return 0; }