main = do
  [n,y] <- map read . words <$> getLine :: IO [Int]
  let c = [[k,j,i] | i<-[0..n], j<-[0..(n-i)], let k=n-i-j, (i*1000 + j*5000 + k*10000)==y]
  putStrLn $ unwords $ map show (if not $ null c then head c else [-1,-1,-1])