#include <stdio.h>

int main(void)
{
	int a, b;
	int c100, c500, c1000;
	
	while (1){
		scanf("%d%d", &a, &b);
		if (a == 0 && b == 0){
			break;
		}
		
		b -= a;
		
		c1000 = b / 1000;
		b = b % 1000;

		c500 = b / 500;
		b = b % 500;
	
		c100 = b / 100;
		b = b % 100;

		printf("%d %d %d\n", c100, c500, c1000);
	}
	
	return (0);
}