#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REP2(i, x, n) for (ll i = x; i < (n); i++)
const long long INF = numeric_limits<long long>::max();
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

string func(ll N, ll Y)
{

    for (ll i = 0; i <= N; ++i)
    {
        ll iAmount = 10000 * i;
        for (ll j = 0; j <= (N-i); ++j)
        {
            ll jAmount = 5000 * j;
            ll k = N - (i + j);
            if ( k < 0 )    continue;
            if (iAmount + jAmount + 1000 * k == Y)
            {

#ifdef SOURCE_TEST
                cout << N << " " << Y << endl;
                cout << i + j + k << endl;
                cout << i * 10000 + j * 5000 + k * 1000 << endl;
#endif
                return to_string(i) + " " + to_string(j) + " " + to_string(k);
            }
        }
    }

    return "-1 -1 -1";
}
int main()
{
    ll N, Y;
    cin >> N >> Y;

    cout << func(N, Y) << endl;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

// syntax sugar: `for (int i = 0; i < N; ++i)`
#define rep(i, N) for (int i = 0; i < (int)(N); ++i)
#define rep2(i, startValue, N) for (int i = (int)(startValue); i < (int)(N); ++i)
// syntax sugar: `for (int i = 0; i < N; ++i)`
#define REP(type, name, beginValue, endCondValue) \
  for (type name = beginValue; name < endCondValue; ++name)
// syntax sugar: 多次元vector
#define VECTOR_DIM3(T, name, d1, d2, d3, initValue) \
    std::vector<std::vector<std::vector<T>>> name(d1, std::vector<std::vector<T>>(d2, std::vector<int>(d3, initValue)));
#define VECTOR_DIM2(T, name, d1, d2, initValue) \
    std::vector<std::vector<T>> name(d1, std::vector<T>(d2, initValue));
#define VECTOR_DIM1(T, name, d1, initValue) \
    std::vector<T> name(d1, initValue);
#define ll long long
#define ld long double

// ABC085C - Otoshidama
int main(){
  int n, y; // 1 <= n <= 2000
  cin >> n >> y;

  for (int a = 0; a <= n; ++a) {
    const int total = a * 10000;
    if (y < total) {
      break;
    }
    for (int b = 0; b <= n-a; ++b) {
      const int total2 = total + b * 5000;
      if (y < total2) {
        break;
      }
      const int c = (n-a-b);
      if (total2 + c * 1000 == y) {
        cout << a << " " << b << " " << c << endl;
        return 0;
      }
    }
  }
  cout << "-1 -1 -1" << endl;
  return 0;
}
