n,y=(int(i) for i in input().split())
must_one=int((y%5000)/1000)
max_five=int(y/5000)
a,b,c = 0,max_five,must_one
while True:
z = n - a - b - c
if z == 0:
break
elif z > 0 :
if z >=9 and a>=1:
a,b,c = a - 1 , b , c + 10
else:
a,b,c = a , b - 1 , c + 5
elif z < 0 :
if z <= -9 and c >=10 + must_one:
a,b,c = a + 1 , b , c - 10
else:
a,b,c = a + 1, b -2 , c
if b < 0:
a,b,c= -1,-1,-1
break
print("%d %d %d"%(a,b,c))