A, B = eval(input()), eval(input())

if len(A) > len(B):

    print("GREATER")

elif len(A) < len(B):

    print("LESS")

elif A > B:

    print("GREATER")

elif A < B:

    print("LESS")

else:

    print("EQUAL")

A, B = eval(input()), eval(input())

C = len(A) - len(B)

if C == 0 and A > B or C > 0:

    print("GREATER")

elif C == 0 and A < B or C < 0:

    print("LESS")

else:

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

A, B = eval(input()), eval(input())
C = len(A) - len(B)
if C == 0 and A > B or C > 0:
    print("GREATER")
elif C == 0 and A < B or C < 0:
    print("LESS")
else:
    print("EQUAL")

-if len(A) > len(B): +C = len(A) - len(B) +if C == 0 and A > B or C > 0: -elif len(A) < len(B): -    print("LESS") -elif A > B: -    print("GREATER") -elif A < B: +elif C == 0 and A < B or C < 0: