#include <bits/stdc++.h>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
    int A, B;
    while (cin >> A >> B, A && B) {
        int C = B - A;
        int div[] = {1000, 500, 100};
        vector<int> ans;
        rep(i, 3) {
            ans.push_back(C / div[i]);
            C %= div[i];
        }
        reverse(all(ans));
        rep(i, 3) cout << ans[i] << (i == 2 ? '\n' : ' ');
    }

    return 0;
}