import           Control.Monad
import           Control.Applicative

main :: IO ()
main = do
  a <- getLine
  b <- getLine

  putStrLn $ f a b

f :: String -> String -> String
f "" "" = "EQUAL"
f "" _  = "LESS"
f _  "" = "GREATER"
f (a : as) (b : bs) | a > b     = "GREATER"
                    | a < b     = "LESS"
                    | otherwise = f as bs