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())

money = [10000, 5000, 1000]
x = [0, 0, 0]
for i in range(3):
    while True:
        if y - money[i] >= 0:
            y -= money[i]
            x[i] += 1
        else:
            break
if y == 0:
    print(' '.join(map(str, x)))
else:
    print('-1 -1 -1')

n, y = map(int, input().split())
res = [-1, -1, -1]
for a in range(n + 1):
    for b in range(n - a + 1):
        if 10000 * a + 5000 * b + 1000 * (n - a - b) == y:
            res[0] = a
            res[1] = b
            res[2] = n - a - b
print(' '.join(map(str, res)))
