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