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.
#input
N,Y = map(int,input().split())
#A = list(map(int, input().split()))


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




for x in range(N):
    for y in range(N):
        for z in range(N):
            if x+y+z == N:
                list = [x,y,z]
                if Y == 10000*list[0]+5000*list[1]+1000*list[2]:
                    ans = list
                    break

print(ans)
#input
N,Y = map(int,input().split())
#A = list(map(int, input().split()))


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


for x in range(N+1):
    for y in range(N+1):
        z = N - x - y
        if z >= 0:
            list = [x,y,z]
            if Y == 10000*list[0]+5000*list[1]+1000*list[2]:
                ans = list
                break
print(ans[0],ans[1],ans[2])