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

for i in range(n+1):
    for j in range(n-i+1):
        for k in range(n-i-j+1):
            if 10000 * i + 5000* j + 1000 * k == y:
                ans = "%s %s %s"%(i, j, k)
                break
            else:
                continue
try:
    print(ans)
except:
    print("-1 -1 -1")
n, y = map(int, input().split())

for i in range(n+1):
    for j in range(n-i+1):
        if 10000 * i + 5000* j + 1000 * (n-i-j) == y:
            ans = "%s %s %s"%(i, j, n-i-j)
            break
        else:
            continue
try:
    print(ans)
except:
    print("-1 -1 -1")
