#include <bits/stdc++.h>
using namespace std;

int main() {
	int A, B;
	while (cin >> A >> B, A) {
		int C = B - A;
		int x = C / 1000;
		C %= 1000;
		int y = C / 500;
		C %= 500;
		int z = C / 100;
		cout << z << " " << y << " " << x << endl;
	}
}
