#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,m;
	cin>>n>>m;
	string command;
	int map[205][205]={};
	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++) {
	 				cout << map[i][j];
	 			}
	 			cout << endl;
	    	}
	    	break;
		}
		else{
			string feedback;
			command = 'LEFT';
	 		cout << command << endl;
	 		cin >> feedback;
		}
	}
}