import java.math.BigDecimal
fun main(args: Array<String>) {
    val A = BigDecimal(readLine())
    val B = BigDecimal(readLine())
   val result =  when{
        A>B -> "GREATER"
        A<B -> "LESS"
        else -> "EQUAL"
    }
    println(result)
}