#include <bits/stdc++.h>
using namespace std;
char a[15][15]={'#'};
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	bool j1=false,j2=false,j3=false,j4=false;
	int k=0,j=0,n=1,m=1,all_explored=0;
	string feedback,command;
	a[11/2][11/2]='.';
	for(int i=1; i<=n; i++){
		cout<<"LEFT"<<endl;
		cin>>feedback;// = get_feedback(command);
		if(feedback=="E"){
			n++;
			k++;
			j4=true;
		}
		if(feedback=="W"){
			n++;
			k--;
			j3=true;
		}
		if(feedback=="S"){
			m++;
			j++;
			j2=true;
		}
		if(feedback=="N"){
			m++;
			j--;
			j1=true; 
		}
		cout<<"GO"<<endl;
		cin>>feedback ;//= get_feedback(command);
		if(feedback=="FAIL"){ 
			a[j][k]='#';
		}
		else{
			a[j][k]='.';
		}
		if(j1==true&&j2==true&&j3==true&&j4==true){
			all_explored=1;
		}
		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 << a[i][j];  
	        }        
		    cout << endl; 
       } 
	   break;
	}
}
	return 0;
}