main = do
   [n,y] <- (map read) . words <$> getLine
   let ans = take 1 [[a,b,n-(a+b)] |
                        a<-[0..n],
                        b<-[0..n],
                        let c=n-(a+b) in c >=0 && a*10000+b*5000+c*1000==y]
   putStrLn . unwords . map show $ if (length ans) == 0
                                then replicate 3 (-1)
                                else ans !! 0