#include <iostream>
using namespace std;

int main(){
    int a, b;

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