str_num_comp::String -> String-> String
str_num_comp x y =  if length x >  length y then "GREATER" else
                    if length x <  length y then "LESS" else same_dig x y
                      where same_dig x y = if (x == []) && (y == []) then "EQUAL" else
                                              let (a,b) = (head x,head y) in
                                              if (read [a]::Int)>(read [b]::Int) then "GREATER" else
                                              if (read [a]::Int)<(read [b]::Int) then "LESS" else same_dig (tail x) (tail y)


main::IO()
main =do
  a<-getLine
  b<-getLine
  putStr (str_num_comp a b)
  putStr "\n"
