const main = args => {
  const [n, y] = args.split(' ').map(arg => +arg);
  let ans = [-1, -1, -1];

  [...Array(n + 1)].forEach((_, i) => {
    let flg = false;
    [...Array(n + 1)].forEach((_, j) => {
      if (i + j > n) return;
      if (10000 * i + 5000 * j + 1000 * (n - (i + j)) === y) {
        ans = [i, j, n - (i + j)];
        return flg = true;
      }
    });
    if (flg) return;
  });

  console.log(ans.join(' '));
};
main(require('fs').readFileSync('/dev/stdin', 'utf8'));