let ans a b =
  let c =
    let n = String.length a
    and m = String.length b in
    if n > m then 0
    else if n < m then 1
    else
      let rec f i =
        if i = n then 2
        else if a.[i] > b.[i] then 0
        else if a.[i] < b.[i] then 1
        else f (i + 1)
      in f 0
  in match c with
    0 -> "GREATER"
  | 1 -> "LESS"
  | _ -> "EQUAL"

let () =
  let a = read_line ()
  and b = read_line ()
  in print_string (ans a b)
