import  scala.io.StdIn
object Main extends App {
  val a = StdIn.readLine()
  val b = StdIn.readLine()
  if(b(0) == "-")println("LESS")
  else {
    (a, b) match {
      case (a, b) if (a.length > b.length) => println("GREATER")
      case (a, b) if (a.length < b.length) => println("LESS")
      case (a, b) if (a.length == b.length) => {
        if (a == b) println("EQUAL")
        else {
          for (i <- 0 to a.length) {
            if (a(i) > b(i)) println("GREATER")
            else if (a(i) < b(i)) println("LESS")
          }
        }
      }
      case _ => println("")
    }
  }
}