#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
string s,t;
int main()
{
	cin>>s;
	cin>>t;
	if(s.size() > t.size()) cout<<"GREATER"<<endl;
	else if(s.size() < t.size()) cout<<"LESS"<<endl;
	else {
		int flag = 0;
		for(int i = 0; i < s.size(); i++){
			if(s[i] > t[i]) {
				flag = 1;
				break;
			}
			else if(s[i] < t[i]) {
				flag = 2;
				break;
			}
		}
		if(flag == 1) cout<<"GREATER"<<endl;
		else if(flag == 2) cout<<"LESS"<<endl;
		else if(flag == 0) cout<<"EQUAL"<<endl;
	}
}