#coding:utf-8



if __name__ == "__main__":

    a = int(input())

    b = int(input())



    if a > b:

        print("GREATER")

    elif a < b:

        print("LESS")

    elif a == b:

        print("EQUAL")

#coding:utf-8

import math



if __name__ == "__main__":

    a = input()

    b = input()



    if len(a) > len(b):

        print("GREATER")

    elif len(a) < len(b):

        print("LESS")

    elif len(a) == len(b):

        for i in range(len(a)):

            if a[i] > b[i]:

                print("GREATER")

                break

            elif a[i] < b[i]:

                print("LESS")

                break

            elif a[i] == b[i] and i == len(a) - 1:

                print("EQUAL")





# coding:utf-8
if __name__ == "__main__":
    a = int(input())
    b = int(input())
    if a > b:
        print("GREATER")
    elif a < b:
        print("LESS")
    elif a == b:
        print("EQUAL")

# coding:utf-8
import math

if __name__ == "__main__":
    a = input()
    b = input()
    if len(a) > len(b):
        print("GREATER")
    elif len(a) < len(b):
        print("LESS")
    elif len(a) == len(b):
        for i in range(len(a)):
            if a[i] > b[i]:
                print("GREATER")
                break
            elif a[i] < b[i]:
                print("LESS")
                break
            elif a[i] == b[i] and i == len(a) - 1:
                print("EQUAL")

+import math + -    a = int(input()) -    b = int(input()) -    if a > b: +    a = input() +    b = input() +    if len(a) > len(b): -    elif a < b: +    elif len(a) < len(b): -    elif a == b: -        print("EQUAL") +    elif len(a) == len(b): +        for i in range(len(a)): +            if a[i] > b[i]: +                print("GREATER") +                break +            elif a[i] < b[i]: +                print("LESS") +                break +            elif a[i] == b[i] and i == len(a) - 1: +                print("EQUAL")