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())
ans = "-1 -1 -1"
if Y < 1000 * N or Y > 10000 * N:
    print(ans)
for i in range(N):
    sen = i
    go = int((10000 * (N - i) - (Y - 1000 * sen)) / 5000)
    man = N - sen - go
    if 1000 * sen + 5000 * go + 10000 * man == Y and sen >= 0 and go >= 0 and man >= 0:
        ans = [sen, go, man]
        ans = map(str, ans)
        result = " ".join(ans)
        print(result)
        quit()

print(ans)
N, Y = map(int, input().split())
flg = 0

for i in range(N+1):
    for j in range(N + 1 - i):
        if i * 10000 + j * 5000 + (N - i - j) * 1000 == Y:
            ans = "{} {} {}".format(i,j,(N - i - j))
            flg = 1
            break
if flg:
    print(ans)
else:
    print("-1 -1 -1")

