fun main(array: Array<String>)  {
    val a = readLine()!!
    val b = readLine()!!

    when {
        a.length > b.length -> print("GREATER")
        a.length < b.length -> print("LESS")
        a > b -> print("GREATER")
        a < b -> print("LESS")
        else -> print("EQUAL")
    }

}