-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU main = putStrLn . unlines . map snd . foldl1 (flip ((zip [0 .. ] .) . map . (maybe "" id .) . (. fst) . flip lookup)) . zipWith ($) [(`zip` ["X", "Y", "Z"]) . zipWith ($) [(!! 1), foldl1 (-) ,(!! 2)] . replicate 3 . zipWith ($) [sum, maximum, minimum] . replicate 3 . map fst, id] . replicate 2 . (`zip` ["A", "B", "C"]) . map ((+ 0) . read) . words =<< getContents