'use strict'
const inputs = require('fs').readFileSync(0, 'utf8').split(' ')
const n = inputs[0]
const y = inputs[1]
for (let j = 0;j <= 8;j++) {
  const remain = y - 5000 * j
  if (remain < 0) break
  const man = (remain - 1000 * (n - j)) / 9000
  if (Number.isInteger(man) && man >= 0 && n - j - man >= 0) return console.log(man, j, n - j - man)
}
return console.log(-1, -1, -1)