import java.util.*

val sc = Scanner(System.`in`)
val A: String = sc.next()
val B: String = sc.next()

fun main(args: Array<String>) {
    println(arrayOf("GREATER", "LESS", "EQUAL")[judge(A, B)])
}

fun judge(A: String, B: String): Int {
    when (A.length - B.length) {
        in 1..Int.MAX_VALUE -> {
            return 0
        }
        in Int.MIN_VALUE..-1 -> {
            return 1
        }
        0 -> {
            for (i in 0 until Math.max(A.length, B.length)) {
                if (i == A.length) {
                    return 1
                }
                if (i == B.length) {
                    return 0
                }
                when (A[i] - B[i]) {
                    in 1..Int.MAX_VALUE -> {
                        return 0
                    }
                    in Int.MIN_VALUE..-1 -> {
                        return 1
                    }
                }
            }
        }
    }
    return 2
}