import qualified Data.ByteString.Char8 as BS
import Data.Ord (comparing)

readInt :: String -> Int
readInt = read

main = do
  first <- map (readInt . BS.unpack) . BS.words <$> BS.getLine
  second <- map (readInt . BS.unpack) . BS.words <$> BS.getLine
  print $ case comparing length first second of
    LT -> "LESS"
    EQ -> "EQUAL"
    GT -> "GREATER"
