#include <stdio.h>
int a, b;
int main() {
	while (true) {
		scanf("%d%d", &a, &b);
		if (a == 0 && b == 0) break;
		printf("%d %d %d\n", (b - a) / 100 % 5, (b - a) / 500 % 2, (b - a) / 1000);
	}
	return 0;
}