import std.stdio;
import std.array;
import std.conv;
import std.algorithm;
struct Reader {
    char[][] inputs;
    ulong idx;
    bool nextLine() {
        char[] buf;
        if(readln(buf)==0) return 0;
        inputs=split(buf);
        idx=0;
        return 1;
    }
    char[] nextItem() {
        if(idx==inputs.length) {
            nextLine();
            idx=0;
        }
        return inputs[idx++];
    }
    int nxtInt() {
        return to!int(nextItem());
    }
    double nxtDouble() {
        return to!double(nextItem());
    }
    char[] nxtStr() {
        return nextItem();
    }
}
void main() {
    Reader r;
    int N=r.nxtInt();
    int Y=r.nxtInt();
    for(int i=0;i<=N;i++) {
        for(int j=0;i+j<=N;j++) {
            if(10000*i+5000*j+1000*(N-i-j)==Y) {
                writefln("%d %d %d",i,j,N-i-j);
                return;
            }
        }
    }
    writeln("-1 -1 -1");
}