#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<map>
#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
	string a,b;
	cin>>a>>b;
	int len1=a.length();
	int len2=b.length();
	if(len1>len2)
	   cout<<"GREATER"<<endl;
	else if(len1<len2)
	   cout<<"LESS"<<endl;
	else
	{
		if(a>b)
		   cout<<"GREATER"<<endl;
		else if(a<b)
		   cout<<"LESS"<<endl;
		else
		   cout<<"EQUAL"<<endl;
		
	}
	return 0;
}