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, Y = map(int,input().split())
l0 = ""
for i in range(N+1):
  for j in range(N+1):
    z = Y - (10000*i) - (5000*j)
    k = z // 1000
    if z % 1000 == 0 and 0 <= k <= N:
      l0 = str(i) + " " + str(j) + " " + str(k)
    else:
      l1 = "-1 -1 -1"
if l0 != "":
  print(l0)
else:
  print(l1)
N, Y = map(int,input().split())
l0 = ""
for i in range(N+1):
  for j in range(N+1):
    z = Y - (10000*i) - (5000*j)
    k = z // 1000
    if z % 1000 == 0 and i+j+k == N and 0 <= k <= N:
      l0 = str(i) + " " + str(j) + " " + str(k)
    else:
      l1 = "-1 -1 -1"
if l0 != "":
  print(l0)
else:
  print(l1)