import java.util.Scanner

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

  val m = a.length
  val n = b.length
  if (m < n){
    println("LESS")
  }
  else if (n < m){
    println("GREATER")
  }
  else {
    var f = true
    for (i in 0..m - 1){
      if (a[i] < b[i]){
        println("LESS")
        f = false
        break
      }
      else if (b[i] < a[i]){
        println("GREATER")
        f = false
        break
      }
    }
    if (f){
      println("EQUAL")
    }
  }
  cin.close()
}