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("EQUAL")

else :

    print("LESS")

import math

a = int(eval(input()))

b = int(eval(input()))

if a > b :

    print("GREATER")

elif a == b :

    print("EQUAL")

else :

    print("LESS")

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("EQUAL")
else:
    print("LESS")

import math

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

-a = math.log10(a) -b = math.log10(b)