A = int(eval(input()))

B = int(eval(input()))

if A>B:

    print("GREATER")

elif A<B:

    print("LESS")

else:

    print("EQUAL")
A = input().strip()

B = input().strip()

if len(A)>len(B):

    print("GREATER")

elif len(A)<len(B):

    print("LESS")

else:

    if A<B:

        print("LESS")

    elif A>B:

        print("GREATER")

    else:

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

A = input().strip()
B = input().strip()
if len(A) > len(B):
    print("GREATER")
elif len(A) < len(B):
    print("LESS")
else:
    if A < B:
        print("LESS")
    elif A > B:
        print("GREATER")
    else:
        print("EQUAL")

-A = int(eval(input())) -B = int(eval(input())) -if A > B: +A = input().strip() +B = input().strip() +if len(A) > len(B): -elif A < B: +elif len(A) < len(B): -    print("EQUAL") +    if A < B: +        print("LESS") +    elif A > B: +        print("GREATER") +    else: +        print("EQUAL")