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.
N, M = map(int,input().split())

for x in range(0,10):
	for y in range(0,10):
		if x + y <= N:
			z = N - (x + y)
			if x + y + z == N:
				if x * 10000 + y * 5000 + z * 1000 == M:
					print(x,y,z)
					exit()
N,Y = map(int,input().split())

list = [-1,-1,-1]

for x in range(N+1):
  for y in range(N+1-x):
    z = N - x - y
    if (x*10000) + (y*5000) + (z*1000) == Y and z <= Y:
      list[0] = x
      list[1] = y
      list[2] = z

ans = ""
for i in list:
  ans += str(i) + " "
print(ans.rstrip())