"use strict";
 
var main = function main(input) {
  var N = input.split(' ')[0];
  var Y = input.split(' ')[1];
  var flag = false;
 
  for (var i = 0; i <= N; i++) {
    var Yminus1000 = Y - 1000 * i;
 
    for (var j = 0; j <= N - i; j++) {
      var Yminus1000minus5000 = Yminus1000 - 5000 * j;
      var k = Yminus1000minus5000 / 10000;
 
      if (Yminus1000minus5000 % 10000 == 0 && i + j + k == N) {
        console.log("".concat(k, " ").concat(j, " ").concat(i));
        flag = true;
        break;
      }
    }
 
    if (flag) {
      break;
    }
  }
 
  if (!flag) {
    console.log("-1 -1 -1");
  }
};
 
main(require('fs').readFileSync('/dev/stdin', 'utf-8'));