n, k = io.read("*n", "*n")
k = k / 1000
z = k % 5
x, y = -1, -1
while(z <= n) do
    nt, kt = n - z, k - z
    a = kt - nt * 5
    if(a % 5 == 0) then
        x = a / 5
        if(x <= nt and 0 <= x) then
            y = nt - x
            break
        end
    end
    z = z + 5
end
if(0 <= y) then io.write(string.format("%d %d %d\n", x, y, z)) else print("-1 -1 -1") end
