def otoshidama():
    N,Y = map(int, input().split())

    for i in range(N + 1):
        for j in range(N + 1 - i):
            k = N - i - j
            if i * 10000 + j * 5000 + k *1000 == Y:
                print('{0} {1} {2}'.format(i,j,k))
                return

    print('{0} {1} {2}'.format(-1,-1,-1))

def main():
    otoshidama()

if __name__ == '__main__':
    main()
