#include <iostream>
using namespace std;

int main(){
	while(1){
		int a,b;
		cin >> a >> b;
		if(b==0) break;
		
		int a100, a500, a1000;
		b -= a;
		a1000 = b/1000;
		b %= 1000;
		a500 = b/500;
		b %= 500;
		a100 = b/100;
		cout << a100 << " " << a500 << " " << a1000 << endl;
	}
	return 0;
}

