import math



A = int(eval(input()))

B = int(eval(input()))

A = math.log10(A)

B = math.log10(B)



if A > B:

    print('GREATER')

elif A < B:

    print('LESS')

else:

    print('EQUAL')

import math



A = int(eval(input()))

B = int(eval(input()))

#A = math.log10(A)

#B = math.log10(B)



if A > B:

    print('GREATER')

elif A < B:

    print('LESS')

else:

    print('EQUAL')

import math

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

import math

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

-A = math.log10(A) -B = math.log10(B) +# A = math.log10(A) +# B = math.log10(B)