import std.stdio, std.string, std.conv, std.algorithm;

void main()
{
    while(true)
    {
        auto input=readln.split.map!(to!int);
        if(input[0]==0&&input[1]==0) break;
        int m=input[1]-input[0];
        int th, fiv, han;
        for(; m>=1000; ++th) m-=1000;
        for(; m>=500; ++fiv) m-=500;
        for(; m>=100; ++han) m-=100;
        writeln(han, " ", fiv, " ", th);
    }
}