#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;

int main()
{
	string a,b;
	int A,B;
	cin>>a>>b;
	A = a.length();
	B = b.length();
	if(A > B) printf("GREATER\n");
	else if(A < B) printf("LESS\n");
	else
	{
		if(a > b) printf("GREATER\n");
		else if(a < b) printf("LESS\n");
		else printf("EQUAL\n");
	}
}