#include <iostream>
using namespace std;

int main(){
  int a, b;

  while(cin >> a >> b, a || b){
    b -= a;

    int ans1000 = b / 1000;
    b %= 1000;
    int ans500 = b / 500;
    b %= 500;

    cout << b / 100 << " " << ans500 << " " << ans1000 << endl;
  }
}