main :: IO ()
main = do
  [n, o] <- map read . words <$> getLine
  let
    ans = [[x, y, z] | x <- [0..n], y <- [0..n-x], z <- [n-x-y], 10000 * x + 5000 * y + 1000 * z == o]
  if null ans
    then putStrLn "-1 -1 -1"
    else putStrLn $ unwords $ map show $ head ans