import Control.Applicative import Data.List import qualified Data.Map as M solve ws = if M.null $ solve' ws then "impossible" else "possible" solve' ws = M.filterWithKey (\(_,w) _ -> w*2 == sum ws) $ last $ unfoldr go (ws, M.singleton (0,0) True) where go ([],m) = Nothing go (x:xs,m) = let m' = M.union m $ M.fromList $ fmap (\((k,w),v) -> ((k+1,w+x),v)) $ M.assocs m in Just $ (m', (xs,m')) main = do _ <- getLine ws <- fmap (read :: String -> Int) . words <$> getLine putStrLn $ solve $ ws