#include<cstdio>
#include<cstring>


int main(void)
{
	char a[100+2], b[100+2];
	int r;

	while(scanf("%s%s", a, b)==2)
	{
		r=strlen(a)-strlen(b);
		if(r==0)
		{
			r=strcmp(a, b);
		}
		if(r>0) printf("GREATER\n");
		if(r<0) printf("LESS\n");
		if(r==0) printf("EQUAL\n");
	}

	return 0;
}
