#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll,ll> pll;
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};
#define MOD 1000000007
#define ARRAY_MAX 100005

const int INF = 1e9+7;


int main(){

    int a,b;
    int money[3] = {1000,500,100};
    int cnt[3];

    while(cin >> a >> b,a|b){
        for(int i = 0;i < 3;i++){
            cnt[i] = 0;
        }
        int change = b-a;
        for(int i = 0;i < 3;i++){
            if(change / money[i] != 0){
                cnt[3-i-1] += change/money[i];
                change -= money[i] * (change/money[i]);
            }
        }
        for(int i = 0;i < 3;i++){
            if(i == 0){
                cout << cnt[i];
            }else{
                cout << " " << cnt[i];
            }
        }
        cout << endl;

    }
    
    return 0;
}
