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

ans = []
for a in range(n+1):
    for b in range(n+1):
        c = n-a-b
        if c < 0:
            continue
        if (a*10000 + b*5000 + c*1000) == y:
            ans.append([a, b, c])
print(ans[0]) if len(ans) else print('-1 -1 -1')
n, y = map(int, input().split())

ans = [-1, -1, -1]

for a in range(n+1):
    for b in range(n-a+1):
        if (a*10000 + b*5000 + (n-a-b)*1000) == y:
            ans = [a, b, n-a-b]
print(*ans)