'use strict';

function main(input) {
  const args = input.split(' ');
  const N = parseInt(args[0]),
        Y = parseInt(args[1]);
  
  var result = '-1 -1 -1';
  var sum = 0;
  
  for (let i = 0; i <= N; ++i) {
    for (let j = 0; j <= N; ++j) {
      if (i+j > N) {
        continue;
      }
      sum = 10000*i + 5000*j + 1000*(N-i-j);
      if (sum === Y) {
        result = `${i} ${j} ${N-i-j}`;
        break;
      }
    }
  }
  
  console.log(result);
}

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