#include <bits/stdc++.h> using namespace std; char map[100][100]; int main(){ for(int i = 0;i<100;i++){ for(int j = 0;j<100;j++){ map[i][j]='#'; } } int z = 0; int x=0,y=0; while(true){ string feedback; string command; command="LEFT"; cout<<command<<endl; cin>>feedback; if(z=4){ int m=x+1; int n=y+1; cout<<"END"<<endl; cout<<n<<" "<<m<<endl; for(int i = 0;i<n;i++){ for(int j = 0;j<m;j++){ cout<<map[i][j]; } cout<<endl; } break; } else{ string d = feedback; command="GO"; cout<<command<<endl; cin>>feedback; if(feedback=="FAIL"){ z++; continue; } else{ z=0; if(d="E"){ x++; } else if(d="W"){ x--; } else if(d="S"){ y--; } else if(d="N"){ y++; } map[x+1][y+1]="."; } } } return 0; }