#include<stdio.h>

int main(){
  int n, m, x, y, z;

  while(1){
    scanf("%d %d", &n, &m);
    if(n == 0 && m == 0) break;

    x = m - n;
    z = x / 1000;
    x -= z * 1000;
    y = x / 500;
    x -= y * 500;
    x /= 100;

    printf("%d %d %d\n", x, y, z);
  }

  return 0;
}