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

int main()
{
	char a[105], b[105];
    int al, bl, i;
    gets(a);
    gets(b);
    al = strlen(a);
    bl = strlen(b);
    if(al > bl)
    	printf("GREATER\n");
    if(al < bl)
    	printf("LESS\n");
    if(al = bl)
	{
		for(i = 0; i < al; i++)
        {
        	if(a[i] > b[i])
			{
				printf("GREATER\n");
				break;
			}
			if(a[i] < b[i])
			{
				printf("LESS\n");
				break;
			}
			if(a[i] == b[i])
				continue;
        }
        if(i == al)
        	printf("EQUAL\n");
	}
