/*
  Created by ryuhouketsu on 2017/04/22.
  */
import scala.util.control.Breaks

object Main extends App {
  val b = new Breaks
  val str1 = readLine
  val str2 = readLine
  if (str1.length > str2.length) {
    println("GREATER")
    System.exit(0)
  }
  else if (str1.length < str2.length) {
    println("LESS")
    System.exit(0)
  }
  b.breakable {
    for (i <- 0 to str1.length - 1) {
      if (str1(i) > str2(i)) {
        println("GREATER")
        b.break
      }
      else if (str1(i) < str2(i)) {
        println("LESS")
        b.break
      }
      if (str1(i) == str2(i) && i == str1.length - 1) {
        println("EQUAL")
      }
    }
  }
}
