#include <stdio.h>

int main(void){
	int moneyset[3] = {100,500,1000};
	int num[3];
	int a,b,r,i,n;
	while(1){
		scanf("%d%d",&a,&b);
		if(a == 0 && b == 0){break;}
		r = b - a;
		for(i = 2; i >= 0; i--){
			num[i] =  r / moneyset[i];
			r %= moneyset[i];
		}
		for(i = 0; i < 3; i++){
			printf("%d%c",num[i], i != 2 ? ' ' : '\n');
		}

	}

	return 0;
}