let a = read_line ()
let b = read_line ()
let n = max (String.length a) (String.length b)
let f s = String.make (n - String.length s) '0' ^ s
let _ = print_endline @@ match compare (f a) (f b) with 1 -> "GREATER" | -1 -> "LESS" | _ -> "EQUAL"