main :: IO ()
main = do
    [n,y] <- map read . words <$> getLine
    let (c,d,e) = pirupiru 0 0 n y
    putStrLn $ (show c++" "++ show d ++ " " ++ show e)

pirupiru :: Int -> Int -> Int -> Int -> (Int,Int,Int)
pirupiru a b n y =  if (a*10000 + b*5000 + (n-a-b)*1000 == y) then (a,b,n-a-b)
                    else if a == n then (-1,-1,-1)
                    else if a + b == n then pirupiru (a+1) 0 n y
                    else pirupiru a (b+1) n y 