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