#include<iostream>
using namespace std;

int main() {
	int a, b;
	while (cin >> a >> b, a, b) {
		int x = 0, y = 0, z = 0;

		int c = b - a;
		x = c / 1000;
		c -= x * 1000;

		y = c / 500;
		c -= y * 500;

		z = c / 100;
		cout << z << ' ' << y << ' ' << x << endl;
	}
	return 0;
}