#include<bits/stdc++.h>
using namespace std;
char a[105][105];
int x=50,y=50;
int z=1,step;
char fx;
bool p(int x,int y,int c){
	if(fx=='N') x--;
	else if(fx=='S') x++;
	else if(fx=='W') y--;
	else if(fx=='E') y++;
	if(a[x][y]!='?') return false;
	return true;
}
int main(){
	for(int i=1;i<=100;i++){
		for(int j=1;j<=100;j++) a[i][j]='?';
	}
	a[50][50]='.';
	cout<<"LEFT\n";
	cin>>fx;
	while(true){
		step+=(step%3)+1;
		string com,bac;
		if(z==1) com="GO\n";
		else{
			com="LEFT\n";
		}
		cout<<com;
		cin>>bac;
		if(z==1){//ǰ½øºó 
			if(bac=="FAIL"){
				z=0;
				if(fx=='N') a[x-1][y]='#';
				else if(fx=='S') a[x+1][y]='#';
				else if(fx=='W') a[x][y-1]='#';
				else if(fx=='E') a[x][y+1]='#';
			}
			else{
				if(fx=='N') x--;
				else if(fx=='S') x++;
				else if(fx=='W') y--;
				else if(fx=='E') y++;
				a[x][y]='.';
			}
		}
		else{
			fx=bac[0];
			z=1;
		}
		if(a[x-1][y]=='#'&&a[x+1][y]=='#'&&a[x][y-1]=='#'&&a[x][y+1]=='#'
		||a[x-1][y]=='.'&&a[x+1][y]=='.'&&a[x][y-1]=='.'&&a[x][y+1]=='.'){
			cout<<"END\n";
			break;
		}
	}
	int minx=INT_MAX,miny=INT_MAX,maxx=-INT_MAX,maxy=-INT_MAX; 
	for(int i=1;i<=100;i++){
		for(int j=1;j<=100;j++){
			if(a[i][j]!='?'){
				minx=min(minx,i);
				miny=min(miny,j);
				maxx=max(maxx,i);
				maxy=max(maxy,j); 
			}
		}
	}
	cout<<maxx-minx+1<<" "<<maxy-miny+1<<"\n"; 
	for(int i=minx;i<=maxx;i++){
		for(int j=miny;j<=maxy;j++) if(a[i][j]=='?') a[i][j]='#';
	}
	for(int i=minx;i<=maxx;i++){
		for(int j=miny;j<=maxy;j++) cout<<a[i][j];
		cout<<"\n";
	}
	return 0;
}
/*
######
###..#
#...##
#.#..#
######
*/