import Control.Applicative main :: IO () main = solve <$> f >>= mapM_ putStrLn where f = map read <$> words <$> getLine solve :: [Int] -> [String] solve [a, b, c, d] | d == 10 = ["Impossible"] | otherwise = let ls = replicate b 50 ++ replicate a 100 in f 0 1 ls where f pt m [] = ["Possible", show pt] f pt m xs = let (ys, zs) = splitAt 100 xs in f (pt + sum ys * m) (m * 2) zs