module Main where type Input = [Int] type Output = Maybe Int parse :: String -> Input parse = map read . words . head . lines solve :: Input -> Output solve [1, 1, 1] = Nothing solve input = Just (sum input) render :: Output -> String render output = let f Nothing = "Infinity" f (Just x) = show x in "A+B+C=" ++ f output main :: IO () main = interact ( render . solve . parse )