process.stdin.resume();
process.stdin.setEncoding('utf-8');

function calcBillSheets(num, yen) {
  var billComb = [num, 0, 0];
  var total;

  while ((total = totalSum(billComb)) > yen) {
    if (billComb[1] > 0) {
      billComb[1]--; billComb[2]++;
    } else if (billComb[0] > 0) {
      billComb[0]--; billComb[1]++;
    } else {
      return [-1, -1, -1];
    }
  }

  if (totalSum(billComb) === yen) {
    return billComb;
  } else {
    return [-1, -1, -1];
  }
}

function totalSum(billComb) {
  return billComb[0] * 10000 + billComb[1] * 5000 + billComb[2] * 1000;
}

process.stdin.on('data', function (line) {
  var arg = line.trim().split(' ');
  console.log(calcBillSheets(parseInt(arg[0]), parseInt(arg[1])).join(' '));
  process.exit(0);
});
