import java.util.*;

object MainKt {
  @JvmStatic fun main(args:Array<String>) {
    val A=readLine()!!
    val B=readLine()!!
    
  println(when(A.length==B.length)
    {
      true -> if(A==B) {"EQUAL"} else{
        if((0..(A.length-1)).map{A[it]-B[it]}.filter{it!=0}.toList().get(0)>0) {"GREATER"} else {"LESS"}
      }
      else ->   if(A.length>B.length) {"GREATER"}  else {"LESS"}
    })
  }
}