
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val a = sc.next()
  val b = sc.next()
  
  if (a == b) {
    println("EQUAL")
  } else {
    if (a.length != b.length) {
      if (a.length > b.length) {
        println("GREATER")
      } else {
        println("LESS")
      }
    } else {
      val ret = a.zip(b).find{case (x, y) => x.asDigit < y.asDigit}
      ret match {
        case Some((x, y)) => println("LESS")
        case None => println("GREATER")
      }
    }
  }  
}