#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, an;
  cin >> n >> an;
  for (int x = 0; x <= n; x++) {
    for (int y = 0; y <= n - x; y++) {
      int z = n - x - y;
      if (10000 * x + 5000 * y + 1000 * z == an) {
        cout << x << " " << y << " " << z;
        system("pause");
        return 0;
      }
    }
  }
  cout << "-1 -1 -1";
  system("pause");
  return 0;
}
