#include <stdio.h>

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  for ( ; ; )
  {
    int a, b;
    int e100, e500, e1000;

    scanf ( "%d%d", &a, &b );
    if ( !( a | b ) ) break ;

    a     = b - a;
    e1000 = a / 1000;
    a    %= 1000;
    e500  = a / 500;
    a    %= 500;
    e100  = a / 100;

    printf ( "%d %d %d\n", e100, e500, e1000 );
  }

  return ( 0 );
}