main = do
    [n,y] <- map read . words <$> getLine
    let (a,b,c) = head $ [(a,b,rest) |
                            a <- [0..n],
                            b <- [0..n-a],
                            let rest = n-a-b,
                            10000*a+5000*b+1000*rest==y] ++ [(-1,-1,-1)]
    putStr $ show a ++ " "
    putStr $ show b ++ " "
    putStrLn $ show c 