#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <map>
using namespace std;
typedef long long ll;

int c[] = {
	1000, 500, 100
};

int main(){
	int a, b;
	while(cin >> a >> b && (a || b)){
		int cost = b - a;
		int a[3];
		for(int i = 0; i < 3; i++){
			a[i] = cost / c[i];
			cost %= c[i];
		}
		for(int i = 2; i >= 0; i--){
			if(i != 2) cout << " " ;
			cout << a[i];
		}
		cout << endl;
	}
	return 0;
}