import qualified Data.ByteString.Char8 as BS
import Data.Ord (compare)
 
readInt :: String -> Integer
readInt = read
 
main = do
  first <- map (readInt . BS.unpack) . BS.words <$> BS.getLine
  second <- map (readInt . BS.unpack) . BS.words <$> BS.getLine
  putStrLn $ case compare first second of
    LT -> "LESS"
    EQ -> "EQUAL"
    GT -> "GREATER"