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

  return 0;
}