    #include<iostream>
    #include<cstring>
    #include<cstdio>
    #include<cstdlib>
    #include<algorithm>
    #include<map>
    #include<cmath>
    #include<cstdlib>
    using namespace std;
    const int M=105;
char  a[M],b[M];
 int n,m,flag;

int main()
{
    cin>>a;
    cin>>b;
    int i=0;
    flag=0;
    while(b[i]!='\0')
    {
        if(a[i]=='\0')
        {
            flag=1;
            break;
        }
        i++;
    }
    int j=0;
    while(a[j]!='\0')
    {
        if(b[j]=='\0')
        {
            flag=2;
            break;
        }
        j++;
    }
    if(flag==0)
    {
        int k=0;
        while(b[k]!='\0')
        {
            if(a[k]<b[k])
            {
                flag=1;
                break;
            }
            else if(a[k]>b[k])
            {
                flag=2;
                break;
            }
            else if(a[k]==b[k])
            {
                flag=3;
                k++;
            }

        }
    }
    if(flag==1)
        cout<<"LESS"<<endl;
    if(flag==2)
        printf("GREATER");
    if(flag==3)
        printf("EQUAL");

}
