n,y=io.read("*n","*n")

for i=0,n do
    for j=0,n do
        x=y-10000*i+5000*j
        k=(x%1000==0 and x//1000 or 2*n)
        if i+j+k==n and x>0 then
            print(i,j,k)
            return
        end
    end
end
print(-1,-1,-1)