#include<stdio.h>


int main(){

  int a, b, c1, c5, c10;

  while(scanf("%d %d", &a, &b), a){
    c10=(b-a)/1000;
    c5=(b-a)%1000/500;
    c1=(b-a)%1000%500/100;
    printf("%d %d %d\n", c1, c5, c10);
  }

  return 0;
}