#include<stdio.h>

int main(){
  int n;
  int m;
  int s;
  int a,b,c;
  while(scanf("%d %d",&n, &m), n!=0&&m!=0){
    s=m-n;
    a=s/1000;
    b=(s-1000*a)/500;
    c=(s-1000*a-500*b)/100;

    printf("%d %d %d\n", c, b, a);
  }

  return 0;
}