#include<iostream>
#include<cstdio>  
#include<cstring>  
using namespace std;  
string a,b;  
int main()  
{ 
    while(cin>>a>>b)
    {
    if(a>b)cout<<"GREATER"<<endl;
    else if(a<b)cout<<"LESS"<<endl;
    else cout<<"EQUAL"<<endl;}
	return 0;
}  