#include<cstdio>
int main() {
	int n, y, a, b;
	scanf("%d%d", &n, &y);
	for (a = 0; a * 10000 <= y; a++) {
		for (b = 0; a * 10000 + b * 5000 <= y; b++) {
			if (a * 10000 + b * 5000 + (n - a - b) * 1000 == y) {
				printf("%d %d %d", a, b, n - a - b);
				return 0;
			}
		}
	}
	printf("-1 -1 -1");
	return 0;
}