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

getsolve :: String -> String -> String
getsolve a b
    | aLen > bLen									= "GREATER"
    | aLen < bLen									= "LESS"
    | head a > head b								= "GREATER"
    | head a < head b								= "LESS"
    | aLen == 1										= "EQUAL"
    | otherwise										= getsolve (tail a) (tail b)
    where aLen = length a
          bLen = length b