open System

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f

[<EntryPoint>]
let main _ =
    let [|N;Y|] = reada int
    let mutable x, y, z = -1, -1, -1
    for i in 0..N do
        for j in 0..N-i do
            let k = N - i - j
            if 10000 * i + 5000 * j + 1000 * k = Y then
                x <- i
                y <- j
                z <- k

    printfn "%d %d %d" x y z
    0
