#include<stdio.h>

int main(void)
{
  while(1){
  int m1,m2;
  int a=0,b=0,c=0;
  int margin;

  scanf("%d",&m1); scanf("%d",&m2);
  if(m1==0 && m2==0 )break;

  margin=m2-m1;

  while(1){
    if( margin<1000 )break;
    c++;
    margin-=1000;
  }
  while(1){
    if( margin<500 )break;
    b++;
    margin-=500;
  }
  while(1){
    if( margin<100 )break;
    a++;
    margin-=100;
  }
  printf("%d %d %d\n",a,b,c);
  }
  return 0;
}