main :: IO ()
main = do
  str1 <- getLine
  str2 <- getLine
  putStrLn $ solve str1 str2

solve :: String -> String -> String
solve s1 s2
  | s1 == s2 = "EQUAL"
  | length s1 >= length s2 && go s1 s2 = "GREATER"
  | otherwise = "LESS"
  where
    go _ [] = True
    go [] _ = False
    go (x:xs) (y:ys)
      | x == y = go xs ys
      | x > y = True
      | otherwise = False
    
