#include <iostream>

using namespace std;

const int money[] = {100, 500, 1000};

int main()
{
    int a, b;

    while (cin >> a >> b, a || b) {
        int num[3] = {0};

        a = b - a;
        for (int i = 2; i >= 0; i--) {
            num[i] = a / money[i];
            a -= num[i] * money[i];
        }
        for (int i = 0; i < 2; i++)
            cout << num[i] << " ";
        cout << num[2] << endl;;
    }

    return 0;
}