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