#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
	char a[1005], b[1005];
	scanf("%s %s",a,b);
	int len1 = strlen(a);
	int len2 = strlen(b);
	if(len1 > len2) printf("GREATER\n");
	if(len1 < len2) printf("LESS\n");
	if(len1 == len2)
	{
		if(strcmp(a,b) > 0) printf("GREATER\n");
		if(strcmp(a,b) < 0) printf("LESS\n");
		if(strcmp(a,b) == 0) printf("EQUAL\n");
	}
}