#include<bits/stdc++.h> #define ll long long using namespace std; char mp[305][305]; bool all; ll x,y,maxx,maxy,minx,miny,vis[305][305],q; string c,fx; int main(){ x=y=maxx=maxy=minx=miny=150; while(true){ q++; string f; c="LEFT"; cout<<c<<"\n"; cin>>f; fx=f; mp[x][y]='.'; bool b=true; for(ll i=minx-1;i<=maxx+1;i++){ for(ll j=miny-1;j<=miny+1;j++){ if(vis[i][j]!=4&&mp[i][j]=='.'){ b=false; } } } if(b)all=true; if(all){ break; }else{ if(q%3==1){ c="GO"; cout<<c<<"\n"; cin>>f; if(f=="FAIL"){ if(fx=="E")mp[x][y+1]='#'; if(fx=="W")mp[x][y-1]='#'; if(fx=="S")mp[x+1][y]='#'; if(fx=="N")mp[x-1][y]='#'; }else{ if(fx=="E")y++; if(fx=="W")y--; if(fx=="S")x++; if(fx=="N")x--; maxx=max(maxx,x); minx=min(minx,x); maxy=max(maxy,y); miny=min(miny,y); } vis[x][y]++; }else{ c="LEFT"; cout<<c<<"\n"; cin>>f; } } } cout<<"END"<<"\n"; cout<<maxx-minx+3<<" "; cout<<maxy-miny+3<<"\n"; for(ll i=minx-1;i<=maxx+1;i++){ for(ll j=miny-1;j<=miny+1;j++){ if(i==minx-1&&j==miny-1)cout<<"#"; else if(i==minx-1&&j==miny+1)cout<<"#"; else if(i==maxx+1&&j==miny-1)cout<<"#"; else if(i==maxx+1&&j==miny+1)cout<<"#"; else cout<<mp[i][j]; } cout<<"\n"; } return 0; }