import java.util.Scanner

object Main extends App  {
  val sc = new Scanner(System.in)

  val a = sc.next
  val b = sc.next
  
  val res =
    if (a.length != b.length){
      if (a.length > b.length ) "GREATER"
      else                      "LESS"
    }
    else {
      val diff = (a zip b).find(t => t._1 != t._2)

      diff.map{case (aa, bb) =>
        if (aa > bb) "GREATER"
        else         "LESS"
      }.getOrElse("EQUAL")
      }

  println(res)
}