#include <stdio.h>

int main(void)
{
	int A, B, change;
	int yen[3];
	int i;
	
	while (1){
		scanf("%d %d", &A, &B);
		if (A == 0 && B == 0){
			break;
		}
		
		yen[0] = yen[1] = yen[2] = 0;
		
		change = B - A;
		
		while (change >= 1000){
			yen[2]++;
			change -= 1000;
		}
		while (change >= 500){
			yen[1]++;
			change -= 500;
		}
		while (change >= 100){
			yen[0]++;
			change -= 100;
		}
		
		for (i = 0; i < 3; i++){
			if (i != 0){
				printf(" ");
			}
			printf("%d", yen[i]);
		}
		puts("");
	}
	
	return (0);
}