# -*- coding: utf-8 -*-



A = int(eval(input()))

B = int(eval(input()))



if A > B:

    print('GREATER')

elif A < B:

    print('LESS')

else:

    print('EQUAL')
# -*- coding: utf-8 -*-



A = list(str(eval(input())))

B = list(str(eval(input())))



if len(A) > len(B):

    print('GREATER')

elif len(A) < len(B):

    print('LESS')

elif A == B:

    print('EQUAL')

else:

    for i in range(len(A)):

        if A[i] > B[i]:

            print('GREATER')

            break

        elif A[i] < B[i]:

            print('LESS')

            break
# -*- coding: utf-8 -*-
A = int(eval(input()))
B = int(eval(input()))
if A > B:
    print("GREATER")
elif A < B:
    print("LESS")
else:
    print("EQUAL")

# -*- coding: utf-8 -*-
A = list(str(eval(input())))
B = list(str(eval(input())))
if len(A) > len(B):
    print("GREATER")
elif len(A) < len(B):
    print("LESS")
elif A == B:
    print("EQUAL")
else:
    for i in range(len(A)):
        if A[i] > B[i]:
            print("GREATER")
            break
        elif A[i] < B[i]:
            print("LESS")
            break

-A = int(eval(input())) -B = int(eval(input())) -if A > B: +A = list(str(eval(input()))) +B = list(str(eval(input()))) +if len(A) > len(B): -elif A < B: +elif len(A) < len(B): +elif A == B: +    print("EQUAL") -    print("EQUAL") +    for i in range(len(A)): +        if A[i] > B[i]: +            print("GREATER") +            break +        elif A[i] < B[i]: +            print("LESS") +            break