import std.array;
import std.algorithm;
import std.range;
import std.stdio;


void main() {
    int n, y;
    readf("%d %d\n", &n, &y);
    foreach (i; 0 .. y / 10000 + 1) {
        foreach (j; 0 .. min(y / 5000 + 1, n - i + 1)) {
            auto k = n - i - j;
            if (i * 10000 + j * 5000 + k * 1000 == y) {
                writefln("%d %d %d", i, j, k);
                return;
            }
        }
    }
    writeln("-1 -1 -1");
}