import std;

void main() {
	int n, y;
	scanf("%d %d", &n, &y);
	int[3] mem;
	auto tbl = [9, 4];
	int remain = y / 1000 - n;
	mem[2] = y / 1000;
	while(true) {
		bool succ = false;
		foreach(i; 0..tbl.length){
			if (remain >= tbl[i] && mem[2] >= tbl[i] + 1) {
				remain -= tbl[i];
				mem[2] -= tbl[i] + 1;
				mem[i] += 1;
				succ = true;
				break;
			}
		}
		if (!succ) {
			"-1 -1 -1".write;
			return;
		}
		else if (remain == 0) {
			mem.to!(string[]).join(" ").write;
			return;
		}
	}
}
