let () =
  let a = read_line () in
  let b = read_line () in
  let la = String.length a in
  let lb = String.length b in
  let rec check i =
    if i = la then "EQUAL"
    else
      let c = compare a.[i] b.[i] in
      if c < 0 then "LESS"
      else if c > 0 then "GREATER"
      else check (i+1) in
  let cs = compare la lb in
  let rs = if cs < 0 then "LESS"
           else if cs > 0 then "GREATER"
           else check 0 in
  print_endline rs
