let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (N, Y) = (input[0], input[1])
var flag = true
loop: for x in 0...N {
    for y in 0...N-x {
        let z = N - (x + y)
        if 10000*x + 5000*y + 1000*z == Y{
            print("\(x) \(y) \(z)")
            flag = false
            break loop
        }
    }
}
if flag {
    print("-1 -1 -1")
}