#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	ll a, b;
	while (cin >> a >> b) {
		if (a == 0 && b == 0)break;
		ll k = b - a;
		ll x = k / 1000;
		ll y = (k - 1000 * x) / 500;
		ll z = (k - 1000 * x - 500 * y) / 100;
		cout << z << " " << y << " " << x << endl;
	}
}

