// Aizu 2216: Summer of KMC
// 2017.9.23 bal4u@uu
// Greedy

#include <stdio.h>

int c[3] = {1000, 500, 100};  //??°????????£???????????????

int main()
{
	int a, b, i, ans[3];

	while (scanf("%d%d", &a, &b) && a > 0) {
		b -= a;  //??£????????????
		for (i = 0; i < 3; i++) {
			ans[i] = b/c[i];
			b %= c[i];
		}
		printf("%d %d %d\n", ans[2], ans[1], ans[0]);
	}
	return 0;
}