"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    const [N,Y] = nextIntArray()
    let na = 0
    let nb = 0
    let nc = 0
    const isMatched = (a,b,c) => {
        return a+b+c == N && 10000*a + 5000*b+ 1000*c == Y
    }
    let aMax = Math.ceil(Y/10000)
    let bMax = Math.ceil(Y/5000)
    let cMax = Math.ceil(Y/1000)
    for(let na = 0; na<=aMax;na++){
        for(let nb = 0;nb<=bMax;nb++){
            let nc = N-na-nb
            if(nc<0) continue
            if(isMatched(na,nb,nc)){
                console.log(na, nb,nc)
                return
            }
        }
    }
    console.log(-1,-1,-1)
}
Main()