import Control.Monad
import qualified Data.ByteString.Char8 as BS
import Data.Maybe (fromJust)
import Data.List as List

solve :: String -> String -> String
solve a b
    | lenA > lenB = solve a ("0" ++ b)
    | lenA < lenB = solve ("0" ++ a) b
    | a > b = "GREATER"
    | a < b = "LESS"
    | otherwise = "EQUAL"
    where
        lenA = length a
        lenB = length b

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