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