#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
const int MaxN = 1e5;
char a[105],b[105];

int main()
{
	int n,p,q;
	while(~scanf("%s",a))
	{
		scanf("%s",b);
		n = strcmp(a,b);
		p = strlen(a);
		q = strlen(b);
		if(q < p) printf("GREATER\n");
		else if(q > p) printf("LESS\n");
		else if(q ==p)
		{
			if(n > 0) printf("GREATER\n");
			else if(n < 0) printf("LESS\n");
			else printf("EQUAL\n");
		}
	}
	return 0;
}