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())
flag = 0
for x in range(Y//10000+1) :
    if flag == 0 :
        for y in range(Y//5000+1) :
            if flag == 0 :
                z = N-x-y
                if (10000*x+5000*y+1000*z) == Y and z >= 0 :
                    flag = 1
                    break
            else :
                break
    else :
        break
if flag == 0 :
    print(-1,-1,-1)
else :
    print(x,y,z)
  
N, Y = map(int,input().split())
ans = [-1,-1,-1]
for x in range(N+1) :
    for y in range(N+1-x) :
        if 9000*x + 4000*y + 1000*N == Y :
            ans = [x,y,N-x-y]
print(*ans)
