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


def main():
    x = min(Y // 10000, N)
    y = min((Y - 10000 * x) // 5000, N - x)
    z = min((Y - 10000 * x - 5000 * y) // 1000, N - x - y)

    if 10000 * x + 5000 * y + 1000 * z != Y:
        x = -1
        y = -1
        z = -1

    print(x, y, z)

    return


main()

N, Y = map(int, input().split())


def main():
    
    
    x = Y // 10000
    y = (Y - 10000 * x) // 5000
    z = (Y - 10000 * x - 5000 * y) // 1000

    while True:
        t = x + y + z

        
        if t + 9 <= N and 0 < x:
            x -= 1
            z += 10
            continue

        
        if t + 4 <= N and 0 < y:
            y -= 1
            z += 5
            continue

        
        if t + 1 <= N and 0 < x:
            x -= 1
            y += 2
            continue

        break

    print(x, y, z) if x + y + z == N else print(-1, -1, -1)

    return


main()
