open Bytes
let a, b = Scanf.scanf " %s %s" @@ fun a b -> a, b
let n, m = String.length a, String.length b
let ma = max n m
let a', b' = make ma '0', make ma '0'
let _ =
  List.iter (fun (b, s, l) -> String.iteri (fun i -> set b (i + ma - l)) s) [a', a, n; b', b, m];
  print_endline @@ if a' > b' then "GREATER" else if a' < b' then "LESS" else "EQUAL"