void main() {
    import std.stdio, std.string, std.conv, std.algorithm, std.range, std.array;
    int N, Y;
    readf("%d %d\n", &N, &Y);
    Y /= 1000;
    foreach (i; 0..min(N, Y/10) + 1) {
        foreach (j; 0..min(N-i, (Y-10*i)/5) + 1) {
            auto k = N-i-j;
            if (10*i+j*5+k == Y) {
                writefln("%d %d %d", i, j, k);
                return;
            }
        }
    }
    writeln("-1 -1 -1");
}
