A = int(eval(input()))

B = int(eval(input()))



if A > B:

    print('GREATER')

elif A < B:

    print('LESS')

else:

    print('EQUAL')

As = eval(input())

Bs = eval(input())



lenA, lenB = len(As), len(Bs)

if lenA > lenB:

    print('GREATER')

elif lenA < lenB:

    print('LESS')

else:

    for A, B in zip(As, Bs):

        A, B = int(A), int(B)

        if A > B:

            print('GREATER')

            break

        elif A < B:

            print('LESS')

            break

    else:

        print('EQUAL')

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

As = eval(input())
Bs = eval(input())
lenA, lenB = len(As), len(Bs)
if lenA > lenB:
    print("GREATER")
elif lenA < lenB:
    print("LESS")
else:
    for A, B in zip(As, Bs):
        A, B = int(A), int(B)
        if A > B:
            print("GREATER")
            break
        elif A < B:
            print("LESS")
            break
    else:
        print("EQUAL")

-A = int(eval(input())) -B = int(eval(input())) -if A > B: +As = eval(input()) +Bs = eval(input()) +lenA, lenB = len(As), len(Bs) +if lenA > lenB: -elif A < B: +elif lenA < lenB: -    print("EQUAL") +    for A, B in zip(As, Bs): +        A, B = int(A), int(B) +        if A > B: +            print("GREATER") +            break +        elif A < B: +            print("LESS") +            break +    else: +        print("EQUAL")