#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cstdlib>
#include<algorithm>
using namespace std;

int main()
{
	char a[1005], b[1005];
	int la, lb;
	gets(a);
	gets(b);
	la = strlen(a);
	lb = strlen(b);
	if(la > lb)
	{
    	printf("GREATER\n");
    	return 0;
	}
	else if(la < lb)
	{
		printf("LESS\n");
		return 0;
	}
	else
    {
    	int flag = 0
        for(int i = 0; i < la; i++)
		{
			if(a[i] > b[i])
			{
            	printf("GREATER\n");
            	flag = 1;
            	return 0;
			}
            else if(a[i] < b[i])
			{
                printf("LESS\n");
                flag = 1;
                return 0;
			}
            else;
		}
		if(flag == 0)
			printf("EQUAL\n");
	}
    return 0;
}