#include <bits/stdc++.h>
using namespace std;

char s[305][305];
bool vis[305][305];

string ask(string s) {
	cout << s << endl;
	string t;
	cin >> t;
	return t;
}

void dfs(int r, int c) {
	s[r][c] = '.';
	while (ask("LEFT") != "N");
	if (!vis[r - 1][c]) {
		vis[r - 1][c] = 1;
		if (ask("GO") == "SUCC") {
			dfs(r - 1, c);
			while (ask("LEFT") != "S");
			ask("GO");
		}
	}
	while (ask("LEFT") != "W");
	if (!vis[r][c - 1]) {
		vis[r][c - 1] = 1;
		if (ask("GO") == "SUCC") {
			dfs(r, c - 1);
			while (ask("LEFT") != "E");
			ask("GO");
		}
	}
	while (ask("LEFT") != "S");
	if (!vis[r + 1][c]) {
		vis[r + 1][c] = 1;
		if (ask("GO") == "SUCC") {
			dfs(r + 1, c);
			while (ask("LEFT") != "N");
			ask("GO");
		}
	}
	while (ask("LEFT") != "E");
	if (!vis[r][c + 1]) {
		vis[r][c + 1] = 1;
		if (ask("GO") == "SUCC") {
			dfs(r, c + 1);
			while (ask("LEFT") != "W");
			ask("GO");
		}
	}
}

int main() {
	memset(s, '#', sizeof s);
	s[153][153] = '.';
	vis[153][153] = 1;
	dfs(153, 153);
	int l = 114514, r = -114514, u = 114514, d = -114514;
	for (int i = 1; i < 303; i++) {
		for (int j = 1; j < 303; j++) {
			if (s[i][j] == '.') {
				l = min(l, j);
				r = max(r, j);
				u = min(u, i);
				d = max(d, i);
			}
		}
	}
	l--, r++, u--, d++;
	cout << "END" << endl;
	cout << d - u + 1 << " " << r - l + 1 << endl;
	for (int i = u; i <= d; i++) {
		for (int j = l; j <= r; j++) {
			cout << s[i][j];
		}
		cout << endl;
	}
	return 0;
}