#include <stdio.h>

int main(){

  int i;
  int a;
  int b;
  int change;
  int x = 0;
  int y = 0;
  int z = 0;

  while(1){
    scanf("%d", &a);
    scanf("%d", &b);
    if(a == 0){
      if(b == 0){
        break;
      }
    }

    change = b - a;

    while(change >= 1000){
      change = change - 1000;
      z++;
    }
    while(change >= 500){
      change = change - 500;
      y++;
    }
    while(change >= 100){
      change = change - 100;
      x++;
    }


    printf("%d %d %d\n", x, y, z);
    x = 0;
    y = 0;
    z = 0;
    change = 0;


  }

  return 0;
}