import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    as <- getLine
    bs <- getLine
    case length as `compare` length bs of
        LT -> putStrLn "LESS"
        EQ -> case as `compare` bs of
            LT -> putStrLn "LESS"
            EQ -> putStrLn "EQUAL"
            GT -> putStrLn "GREATER"
        GT -> putStrLn "GREATER"