import Text.Printf

solve :: Int -> Int ->[(Int,Int,Int)]
solve n yen =
   [(x,y,n-x-y)| x<-[0..n], y<-[0..n-x], x*10000+y*5000+(n-x-y)*1000==yen]

print3 (x,y,z)=
  printf "%d %d %d\n" x y z
  
main = do
  [n, yen] <- map read . words <$> getLine :: IO [Int]
  let anss = solve n yen 
  print3 $ if null anss then (-1,-1,-1) else head anss


