main = do
  a <- getLine
  b <- getLine
  let ans = compute a b
  putStrLn $ msg ans

msg LT = "LESS"
msg GT = "GREATER"
msg EQ = "EQUAL"

compute :: String -> String -> Ordering
compute a b =
  case compare (length a) (length b) of
    EQ -> foldr decide EQ $ zipWith compare a b
    cp -> cp

decide EQ rest = rest
decide cmp _   = cmp
