#include <bits/stdc++.h>
using namespace std;
char map[1005][1005];
string command;
bool all_explored;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	
	while(true){
		string feedback;
		command=;
		cout<<command<<'\n';
		cin>>feedback;
		if(all_explored){
			cout<<"END\n";
			cout<<n<<' '<<m<<'\n';
			for(int i=0;i<n;i++){
				for(int j=0;j<m;j++){
					cout<<map[i][j];
				}
				cout<<'\n';
			}
			break;
		}
		else{
			
		}
	}
	return 0;
}