#include <iostream>
using namespace std;

int main() {
    while (true) {
        int a, b;
        cin >> a >> b;
        if (!a && !b) return 0;

        int diff = b - a;
        int x, y, z;
        z = diff / 1000;
        diff %= 1000;
        y = diff / 500;
        diff %= 500;
        x = diff / 100;
        cout << x << " " << y << " " << z << endl;
    }
}