#include<stdio.h>

int main(){
  int a, b, fish;
  int th, fif, hun;

  while(1){
    scanf("%d%d", &a, &b);
    if(a==0 && b==0){
      break;
    }
    fish=b-a;
    th=fish/1000;
    fif=(fish%1000)/500;
    hun=((fish%1000)%500)/100;
    printf("%d %d %d\n", hun, fif, th);
  }
  
  return 0;
}