#include<iostream>
using namespace std;

int main(){
	long long int a, b;
	int c1000, c500, c100;

	while(cin >> a >> b, a || b){
		b -= a;
		c1000 = b / 1000;
		b -= 1000 * c1000;
		c500 = b / 500;
		b -= 500 * c500;
		c100 = b / 100;

		cout << c100 << " " << c500 << " " << c1000 << endl;
	}
}