#include<stdio.h>
int main()
{
  int tho, han, han5, a, b, x;

  while(1){
    scanf("%d%d", &a, &b);
    
    if(a == 0 && b == 0) break;

    x = b - a;
    tho = 0;
    han = 0;
    han5 = 0;
    
    if(x == 0){
      printf("0 0 0\n");
      break;
    }
	
    while(1){
      

      if(x >= 1000){
	tho = x / 1000;
	x %= 1000;  
      }

    
      if(x >= 500){
	han5 = x / 500;
	x %= 500; 
      }

      if(x >= 100){
	han = x / 100;
	x %= 100;  
      }

      printf("%d %d %d\n", han, han5, tho);
      break;
      
    }
  }

  return 0;
  
}