import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
  val br = BufferedReader(InputStreamReader(System.`in`))

  val a = br.readLine()
  val b = br.readLine()

  val great = "GREATER"
  val less = "LESS"
  val equal = "EQUAL"
  val ans = when {
    a.length > b.length -> great
    a.length < b.length -> less
    else -> when {
      a > b -> great
      a < b -> less
      else -> equal
    }
  }

  println(ans)
}