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

m = a // 10000

b = a - m * 10000
n = b // 5000

c = b - n * 5000
l = c // 1000

s = m + n + l

if s <= N and a % N == 0:
    print(str(m) + " " + str(n) + " " + str(l))
else:
    print("-1" + " " + "-1" + " " + "-1")
N, a = map(int,input().split())
s = 0
t = 0
u = 0

for i in range(N+1):
    for j in range(N+1-i):
        k = N - i - j
        if i * 10000 + j * 5000 + k * 1000 == a:
            s = i
            t = j
            u = k
            break
if s == t == u == 0:
    print("-1" + " " + "-1" + " " + "-1")
else:
    print(str(s) + " " + str(t) + " " + str(u))