/*
  AOJ 2216
  Title:Summer of KMC
  @kankichi573
*/
#include <stdio.h>

main()
{
  int A,B,change,c100,c500,c1000;
  while(scanf("%d %d",&A,&B) && (A||B))
    {
      change=B-A;
      c1000 =change / 1000;
      c100  =(change % 1000)/100;
      if(c100>=5)
	{
	  c500  = 1;
	  c100 -= 5;
	}
      else
	c500=0;
      printf("%d %d %d\n",c100,c500,c1000);
    }
  return(0);
}