let a = read_line () in
let b = read_line () in
let al = String.length a in
let bl = String.length b in
print_endline @@
if al > bl then "GREATER" else
    if al < bl then "LESS" else
        if a > b then "GREATER" else
            if a < b then "LESS" else
                "EQUAL"