a=int(eval(input()))-int(eval(input()));print(('GELRQEEUSAASTL E  R'[(a<1)+(a<0)::3]))
a,b=list(map(int,open(0)));print((['ELQEUSASL'[a<b::2],'GREATER'][a>b]))
a = int(eval(input())) - int(eval(input()))
print(("GELRQEEUSAASTL E  R"[(a < 1) + (a < 0) :: 3]))

a, b = list(map(int, open(0)))
print((["ELQEUSASL"[a < b :: 2], "GREATER"][a > b]))

-a = int(eval(input())) - int(eval(input())) -print(("GELRQEEUSAASTL E  R"[(a < 1) + (a < 0) :: 3])) +a, b = list(map(int, open(0))) +print((["ELQEUSASL"[a < b :: 2], "GREATER"][a > b]))