#include <cstdio>
#include <vector>

int main()
{
	const int cof[] = {100, 500, 1000};

	int A, B;
	while (~scanf("%d %d", &A, &B)) {
		if (A == 0 && B == 0)
			break;
		int diff = B - A;
		std::vector<int> pay(3, 0);
		for (int i = 2; i >= 0; --i) {
			while (diff >= cof[i]) {
				++pay[i];
				diff -= cof[i];
			}
		}
		printf("%d %d %d\n", pay[0], pay[1], pay[2]);
	}
	return 0;
}