#include<iostream>
#include<cstring>

using namespace std;

int main()
{
	string a, b;
	while(cin >> a >> b)
	{
		int lena = a.size();
		int lenb = b.size();
		if(lena < lenb)
			cout<<"LESS"<<endl;
		if(lena > lenb)
			cout<<"GREATER"<<endl;
		if(lena == lenb)
		{
			if(a > b)
			{
				cout<<"GREATER"<<endl;
			}
			if(a < b)
			{
				cout<<"LESS"<<endl;
			}
			if(a == b)
			{
				cout<<"EQUAL"<<endl;
			}			
		}
	}
	return 0;
}