#include<bits/stdc++.h>
using namespace std;

int main(){
	string s1,s2;
	while(cin>>s1>>s2){
		int l1=s1.size(),l2=s2.size();
		if (l1>l2){
			cout<<"GREATER"<<endl;
		}
		else if (l1<l2){
			cout<<"LESS"<<endl;
		}
		else{
			int flag=0;
			for(int i=0;i<l1;i++){
				if (s1[i]>s2[i]){
					flag=1;
					break;
				}
				else if (s1[i]<s2[i]){
					flag=-1;
					break;
				}
			}
			if (!flag) cout<<"EQUAL"<<endl;
			else if (flag==1){
				cout<<"GREATER"<<endl;
			}
			else cout<<"LESS"<<endl;
		}
	}
	return 0;
}