The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.  According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.
#ABC085C
N,Y=map(int,input().split())
d=(Y-N*1000)//1000 #if all 1000yen
print(d)
if d%9==0 and N-d//9>=0:
	print(d//9,0,N-d//9)
	exit()
for n in range(N):
	if d%4==0 and N-n-d//4>=0:
		print(n,d//4,N-n-d//4)
		exit()
	d-=9
print('-1 -1 -1')
#ABC085C
N,Y=map(int,input().split())
d=(Y-N*1000)//1000 #if all 1000yen
if d%9==0 and d//9>=0 and N-d//9>=0:
	print(d//9,0,N-d//9)
	exit()
for n in range(N):
	if d%4==0 and d//4>=0 and N-n-d//4>=0:
		print(n,d//4,N-n-d//4)
		exit()
	d-=9
print('-1 -1 -1')