import Foundation
//10000x + 5000y + 1000z = Y
let rdInt = readLine()!.split(separator: " ").map({Int($0)!})
let N = rdInt[0]
let Y = rdInt[1]

var ansX = -1
var ansY = -1
var ansZ = -1

testlabel: for x in 0 ... N {
    for y in 0 ... N {
        let z = N-x-y
        if z < 0 {
            break
        }
            if 10000*x + 5000*y + 1000*z == Y {
                ansX = x
                ansY = y
                ansZ = N - x - y
                break testlabel
            }
    }
}
print(ansX,ansY,ansZ)