#include <bits/stdc++.h>
using namespace std;
int command,n,m,all_explored;
int main(){
	while (true) {
 		string feedback;
 		command=0; 
		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++)
				cout<<endl;
 			}
			break;
 		}
		else {
 			
 		}
	}
	return 0;
}