#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(strlen(a)>strlen(b))
	   cout<<"GREATER"<<endl;
	else if(strlen(a)<strlen(b))
	   cout<<"LESS"<<endl;
	else
	{
		if(strcmp(a,b)>0)
		   cout<<"GREATER"<<endl;
		else if(strcmp(a,b)<0)
		   cout<<"LESS"<<endl;
		else
		   cout<<"EQUAL"<<endl;
		
	}
	return 0;
}