let a = read_line ()
let b = read_line ()
let n, m = String.length a, String.length b
let _ = print_endline @@ match if n < m then -1 else if n > m then 1 else compare a b with 1 -> "GREATER" | 0 -> "EQUAL" | _ -> "LESS"