'use strict';

function main(input) {
  const YEN_1000 = 1000;
  const YEN_5000 = 5000;
  const YEN_10000 = 10000;
  let ans_i = -1;
  let ans_j = -1;
  let ans_k = -1;
  let inputs = input.split(' ').map(num => parseInt(num, 10));
  let numbers = inputs[0];
  let amount = inputs[1];

  for (let i = 0; i <= numbers; i++) {
    for (let j = 0; j <= numbers - i; j++) {
      let k = numbers - i - j;
      let sum = YEN_10000 * i + YEN_5000 * j + YEN_1000 * k;
      if (i + j + k === numbers && sum === amount) {
        ans_i = i;
        ans_j = j;
        ans_k = k;
      }
    }
  }

  console.log(`${ans_i} ${ans_j} ${ans_k}`);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
