A = int(eval(input()))

B = int(eval(input()))



if A > B :

    print('GREATER')

elif A == B:

    print('EQUAL')

else:

    print('LESS')



A = list(eval(input()))

B = list(eval(input()))



if len(A) > len(B):

    print("GREATER")

elif len(B) > len(A):

    print("LESS")

else:

    for i in range(len(A)):

        if int(A[i]) > int(B[i]):

            print("GREATER")

            quit()

        elif int(A[i]) < int(B[i]):

            print("LESS")

            quit()

        else:

            if i  == len(A) - 1 and int(A[i])==int(B[i]):

                print("EQUAL")

A = int(eval(input()))
B = int(eval(input()))
if A > B:
    print("GREATER")
elif A == B:
    print("EQUAL")
else:
    print("LESS")

A = list(eval(input()))
B = list(eval(input()))
if len(A) > len(B):
    print("GREATER")
elif len(B) > len(A):
    print("LESS")
else:
    for i in range(len(A)):
        if int(A[i]) > int(B[i]):
            print("GREATER")
            quit()
        elif int(A[i]) < int(B[i]):
            print("LESS")
            quit()
        else:
            if i == len(A) - 1 and int(A[i]) == int(B[i]):
                print("EQUAL")

-A = int(eval(input())) -B = int(eval(input())) -if A > B: +A = list(eval(input())) +B = list(eval(input())) +if len(A) > len(B): -elif A == B: -    print("EQUAL") +elif len(B) > len(A): +    print("LESS") -    print("LESS") +    for i in range(len(A)): +        if int(A[i]) > int(B[i]): +            print("GREATER") +            quit() +        elif int(A[i]) < int(B[i]): +            print("LESS") +            quit() +        else: +            if i == len(A) - 1 and int(A[i]) == int(B[i]): +                print("EQUAL")