N=io.read("n")
Y=io.read("n")
local x=-1
local y=-1
local z=-1
local I=Y//10000
local J=Y//5000
for i=1,I do
  for j=1,J do
    if i+j<=N and i*10000+j*5000+(N-i-j)*1000==Y then
      x=i
      y=j
      z=N-i-j
    end
    break
  end
end
print(x,y,z)
      