'use strict';
function Main(inputs) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  const input = inputs.split("\n");
  const n = Number(input[0].split(' ')[0]);
  const y = Number(input[0].split(' ')[1]);
  const state = {
    ichiman: n,
    gosen: 0,
    sen: 0,
    sum: function(){
      return this.ichiman * 10000 + this.gosen * 5000 + this.sen * 1000
    }
  }
  while(state.sum() > y){
    console.log(state.ichiman, state.gosen, state.sen, state.sum());
    if(state.ichiman > 0){
      state.ichiman--;
      state.gosen++;
    }else if(state.gosen > 0){
      state.gosen--;
      state.sen++;
    }else{
      break;
    }
  }
  console.log(state.ichiman, state.gosen, state.sen, state.sum());
  if(state.sum() === y){
    console.log(state.ichiman, state.gosen, state.sen);
  }else{
    console.log('-1 -1 -1');
  }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
