open System

let A = stdin.ReadLine()
let B = stdin.ReadLine()

let comp (s :String) (t :String) = 
    match (s, t) with
        | (s, t) when s.Length <> t.Length -> s.Length.CompareTo t.Length
        | (s, t) -> s.CompareTo t

let show x = 
    match x with
        | 1 -> "GREATER"
        | -1 -> "LESS"
        | _ -> "EQUAL"

comp A B |> show |> printfn "%s"
