import java.math.BigInteger

fun main(args: Array<String>) {
    abc059b()
}

fun abc059b() {
    val a = BigInteger(readLine()!!)
    val b = BigInteger(readLine()!!)

    when {
        a > b -> println("GREATER")
        a < b -> println("LESS")
        else -> println("EQUAL")
    }
}
