import Control.Applicative
import Control.Monad
import Data.List
import Data.Char
strToInt s = (read :: String -> Int) s
strToInteger s = (read :: String -> Integer) s
strToDouble s = (read :: String -> Double) s

main :: IO ()
main = do
    fs <- getLine
    sn <- getLine
    case compare fs sn of
        LT -> putStrLn "LESS"
        EQ -> putStrLn "EQUAL"
        GT -> putStrLn "GREATER"
        otherwise -> putStrLn "BUG"
