#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<map>
#include<iostream>
#include<algorithm>
using namespace std;
char a[105],b[105];

int main()
{
	cin>>a;
	cin>>b;
	if(strcmp(a,b)>0)
	   cout<<"GREATER"<<endl;
	else if(strcmp(a,b)<0)
	   cout<<"LESS"<<endl;
	else
	   cout<<"EQUAL"<<endl;
	return 0;
}