import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val a = sc.next()
  val b = sc.next()

  val ans = a(a, b)
  println(ans)
}

private fun a(a: String, b: String): String {
  val al = a.length
  val bl = b.length
  if (al < bl) return "LESS"
  if (bl < al) return "GREATER"

  for (i in 0 until al) {
    val ai = a[i]
    val bi = b[i]

    if (ai < bi) return "LESS"
    if (bi < ai) return "GREATER"
  }

  return "EQUAL"
}
