open System

let inp = stdin.ReadLine().Split(' ') |> Array.map int
let N = inp.[0]
let Y = inp.[1]

let res = seq {
    for i in 0 .. N do
        for j in 0 .. N-i do
            let k = N - i - j
            if i * 10000 + j * 5000 + k * 1000 = Y then yield (i,j,k)
}


if Seq.isEmpty res then 
    printfn "-1 -1 -1"
else
    let (a,b,c) = Seq.head res
    printfn "%d %d %d" a b c 
