#include <bits/stdc++.h>


using namespace std;
typedef long long ll;

int main() {
  int n;
  scanf("%d", &n);
  ll y;
  scanf("%lld", &y);

  ll x[3] = {10000, 5000, 1000};
  
  for (int i=0; i<n+1; i++) {
    for (int j=0; j<n+1; j++) {
      for (int k=0; k<n+1; k++) {
        if (i*x[0] + j*x[1] + k*x[2] == y && i + j + k == n) {
          printf("%d %d %d\n", i, j, k);
          return 0;
        }
      }
    }
  }
  
  printf("-1 -1 -1\n");
  return 0;
}
