'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ').map(x => Number(x));
  const n = s[0];
  const y = s[1];
  const result = [];

  for (var i = 0; i <= n; i++) {
    for (var j = 0; j <= (n - i); j++) {
      const k = (n - i - j);
      if (10000 * i + 5000 * j + 1000 * k === y && i + j + k === n) {
        result.push([i, j, k]);
      }
    }
  }

  const ans = (result.length >= 1) ? result[0].join(' ') : '-1 -1 -1';
  console.log(ans);
}

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