#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  int a,b;
  int money;
  int o100,o500,o1000;
  while(cin>>a>>b){
    if(a==0&&b==0) break;
    money = b - a;
    o1000 = money / 1000;
    money %= 1000;
    o500 = money / 500;
    money %= 500;
    o100 = money / 100;
    printf("%d %d %d\n",o100,o500,o1000);
  }
  return 0;
}