import Data.List

main = do
  (n:y:_) <- getLine >>= return . map read . words :: IO [Int]

  let d = [(i,j,k) | i<-[0..n], j<-[0..n-i], let k=n-i-j]

  putStrLn $ f (find (\(i,j,k) -> (i*10000+j*5000+k*1000) == y) d)
  where
    f Nothing = "-1 -1 -1"
    f (Just (i,j,k)) = unwords (map show [i,j,k])
