import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as B import Data.List(unfoldr) import Data.Char (isSpace) main :: IO () main = do [x, _, _] <- f solve x <$> f <*> f >>= putStrLn where f = readil B.readInt <$> B.getLine solve :: Int -> [Int] -> [Int] -> String solve x as bs = case (ab, bb) of (True, True) -> "MrMaxValu" (True, False) -> "MrMax" (False, True) -> "MaxValu" _ -> "-1" where ab = x `elem` as bb = x `elem` bs readil :: Integral a => (ByteString -> Maybe (a, ByteString)) -> ByteString -> [a] readil f = unfoldr $ f . B.dropWhile isSpace