"use strict";
function Main(input) {
  input = input.split(" ");
  const totalNum = parseInt(input[0], 10);//countの方が良い
  const otoshidamas = parseInt(input[1], 10);
  let result = "-1-1-1";
  
  for(let ichimanen = 0; ichimanen <= totalNum; ichimanen++){
      for(let gosenen = 0; gosenen <= totalNum - ichimanen; gosenen++){
          const senen = totalNum - (ichimanen + gosenen);
          const otoshidamaSumTotal = (ichimanen*10000) + (gosenen*5000) + (senen*1000);
          if(otoshidamaSumTotal === otoshidamas){
              result = `${ichimanen} ${gosenen} ${senen}`
          }
      }
  }
  console.log(result);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf-8"));