#include<bits/stdc++.h>

using namespace std;

int n,m;
char map[105][105];

int main()
{
	while (true) 
	{
		string feedback;
		command = "LEFT";
		cout << command << endl; 
		cin >> feedback; 
		if (all_explored) 
		{ 
			cout << "END" << endl;
			cout << n << " " << m << endl;
			for (int i = 0; i < n; i++) 
			{
				for (int j = 0; j < m; j++) 
				{
					if(map[i][j]==' ')
						cout<<"# ";
					else cout << map[i][j];
				}
				cout << endl;
			}
			break; 
		}
		else 
		{
			int i=10,j=10;
			string a;
			cout<<"GO";
			cin>>a;
			if(feedback=='N')
			{
				if(a=='FAIL')
					map[i][j]='#';
				else 
				{
					map[i][j]='.';
					i--;
				}
			}
			else if(feedback=='E')
			{
				if(a=='FAIL')
					map[i][j]='#';
				else 
				{
					map[i][j]='.';
					j++;
				}
			}
			else if(feedback=='S')
			{
				if(a=='FAIL')
					map[i][j]='#';
				else 
				{
					map[i][j]='.';
					i++;
				}
			}
			else if(feedback=='W')
			{
				if(a=='FAIL')
					map[i][j]='#';
				else 
				{
					map[i][j]='.';
					j--;
				}
			}
		}
	}
	return 0;
}