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