#include <stdio.h>

int main(){
  int A,B,C,c[3];
  while(1){
    scanf("%d%d",&A,&B);
    if(A == 0 && B == 0)break;
    C = B-A;
    if(C >= 1000){
      c[2] = C / 1000;
      C = C - c[2]*1000;
    }
    else c[2] = 0;
    if(C >= 500){
      c[1] = C / 500;
      C = C - 500;
    }
    else c[1] = 0;
    if(C >= 100){
      c[0] = C / 100;
    }
    else c[0] = 0;

    printf("%d %d %d\n",c[0],c[1],c[2]);
  }

  return 0;
}
    