function Main(input){
  var In = input.split(' ');
  var N = parseInt(In[0], 10);
  var Y = parseInt(In[1], 10);
  var yen10000 = -1;
  var yen5000 = -1;
  var yen1000 = -1;
  
  for(var i = 0; i <= N; i++){
    for(var j = 0; j <= N - i; j++){
      var k = N - i - j;
      var total = 10000 * i + 5000 * j + 1000 * k;
      if(total == Y){
        yen10000 = i;
        yen5000 = j;
        yen1000 = k;
      }
    }
  }
  console.log('%d %d %d', i, j, k);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));