#include <stdio.h>
int main(void){
	int a,b,c,d,e,f;
	while(scanf("%d%d",&a,&b) , a != 0){
		c = b - a;
		d = c % 500;
		e = (c % 1000 - d);
		f = c - d - e;
		printf("%d %d %d\n",d/100,e/500,f/1000);
	}
	return 0;
}