#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cmath>
#define n 10^100
char a[n], b[n];
using namespace std;
int main()
{
	int i, cnt = 0;
	gets(a);
	gets(b);
	if(strlen(a)>strlen(b))
		printf("GREATER\n");
	else if(strlen(a)<strlen(b))
		printf("LESS\n");
    else
	{
    	for(i = 0; i < strlen(a); i++)
	    {
	    	if(a[i]>b[i])
	    	{
		     	printf("GREATER\n");
		    	break;
	    	}
	     	else if(a[i]<b[i])
	     	{
	     		printf("LESS\n");
	     		break;
			}
			else
				cnt++;
		}
		if(cnt == strlen(a))
			printf("EQUAL\n");
	}
}