import Data.Maybe

main :: IO ()
main =do
  [n,y] <- map read . words <$> getLine :: IO [Int]
  let list = [if (a*10+b*5+c)*1000==y then Just [a,b,c] else Nothing
           | a <- [0..n], b <- [0..n-a], let c = n-a-b ] :: [Maybe [Int]]
  putStr . unwords . map show . fromJust . head $ filter isJust list ++ [Just [-1,-1,-1]]