function main(arg) {
  var inputs = arg.trim().split(' ').map(v => parseInt(v));
  var N = inputs[0];
  var Y = inputs[1];

  for (var i = 0; i <= N; i++) {
    if (10000 * i > Y) continue;
    for (var j = 0; j <= N - i; j++) {
      if (10000 * i + 5000 * j > Y) continue;
      for (var k = 0; k <= N - i - j; k++) {
        var total = 10000 * i + 5000 * j + 1000 * k;
        if (total === Y) {
          console.log(i + ' ' + j + ' ' + k);
          return;
        }
      }
    }
  }
  console.log("-1 -1 -1");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
