import  scala.io.StdIn
object Main extends App {
  var a = StdIn.readLine()
  var b = StdIn.readLine()
  
  (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("")
  }

}