"use strict";
function Main(input) {
  input = input.split("\n");
  const totalNum = parseInt(input[0], 10);
  const otoshidama = parseInt(input[1], 10);
  let result = "-1-1-1";
  
  for(let ichimanen = 0; ichimanen <= totalNum; ichimanen++){
      for(let gosenen = 0; gosenen <= totalNum; gosenen++){
          let senen = totalNum - (ichimanen + gosenen);
          let total = ichimanen + gosenen + senen;
          let otoshidamaSumTotal = (ichimanen*10000) + (gosenen*5000) + (senen*1000);
          if(total === totalNums && otoshidamaSumTotal === otoshidama && senen >= 0){
              result = "${ichimanen} ${gosenen} ${senen}"
          }
      }
  }
  console.log(result);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf-8"));