import Control.Applicative import Control.Monad main :: IO () main = solve <$> f >>= putStrLn where f = map read <$> words <$> getLine solve :: [Int] -> String solve [a, b, c] | null ps = "Impossible" | otherwise = show . minimum $ ps where ps = do ac <- [0 .. a] bc <- [0 .. b] let py = ac + 10 * bc p <- [1 .. py] let r = py - p let (u, v) = divMod r 10 guard $ a - ac + b - bc + u + v == c return p