import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

bool calc(int n, int y) {
    for (int a = 0; a <= 2000; a++) {
        int x = y - 1000 * n - 9000 * a;
        if (x < 0) return false;

        if (x % 4000 == 0) {
            int b = x / 4000;
            int c = n - a - b;
            if (c >= 0) {
                writeln(a, " ", b, " ", c);
                return true;
            }
        }
    }
    return false;
}

void main() {
    auto ny = readints;
    int n = ny[0], y = ny[1];

    bool found = calc(n, y);
    if (!found) writeln("-1 -1 -1");
}
