#include <bits/stdc++.h>

using namespace std;

#ifndef ONLINE_JUDGE
  #define pr_debug(...) do { printf("DEBUG: line %d: %s: ", __LINE__, __PRETTY_FUNCTION__); printf(__VA_ARGS__); } while(0)
  #define pr_vars(...) do { pr_debug(" "); pr_var(split(#__VA_ARGS__, ',').begin(), __VA_ARGS__); } while(0)
#else
  __attribute__ ((constructor)) static void fast_cin() { ios_base::sync_with_stdio(false); cin.tie(0); }
  #define pr_debug(...) do { } while(0)
  #define pr_vars(...) do { } while(0)
#endif /* ONLINE_JUDGE */

using ll = int64_t;
using ull = uint64_t;

template<typename T> ostream &operator<< (ostream &fout, const vector<T> &vec)
{ for (const auto &el : vec) fout << el << ' '; return fout; }

template<typename T> istream &operator>> (istream &fin, vector<T> &vec)
{ for (size_t i = 0; i < vec.size(); i++) fin >> vec[i]; return fin; }

vector<string> split(const string &s, char c) { vector<string> v; ull st = 0, fn = 0, lvl = 0;
for ( ; fn < s.size(); fn++ ) { if (s[fn] == c && lvl == 0) { v.push_back(s.substr(st, fn - st)); st = fn + 1; }
if (s[fn] == '(') { lvl++; } if (s[fn] == ')') { lvl--; } } v.push_back(s.substr(st, fn - st)); return v; }

void pr_var(vector<string>::iterator it) { (void) it; cout << endl; }
template<typename T, typename... Args> void pr_var(vector<string>::iterator it, T a, Args... args)
{ cout << *it << "=" << a << "  "; pr_var(++it, args...); }

ll div_ceil(ll n, ll d) { ll res = n / d; if (res >= 0) res += n % d ? 1 : 0; return res; }
ll gcd(ll a, ll b) { a = llabs(a); b = llabs(b); while (a && b) a > b ? a %= b : b %= a; return a + b; }
ll lcm(ll a, ll b) { ll c = gcd(a, b); return c == 0 ? 0 : llabs(a / c * b); }

#define setp(a) fixed << setprecision(a)
const double PI = acos(-1.0);
constexpr double EPS = 1e-9;
constexpr double INF = 2e18;

using mp = pair<ll, ll>;
using mt = tuple<ll, ll, ll>;    // unpack: tie(ll, ll, ll) = mt;

constexpr ll MAX = 1e5 + 5;

int main()
{
    ll n, y; cin >> n >> y;
    ll n1 = 0, n5 = 0, n10 = 0;

    for (n10 = 0; n10 <= 2000; n10++) {
        ll sum = n10 * 10000;
        if (sum > y) continue;
        ll d = y - sum, miss = n - n10;
        if (d > miss * 5000) continue;

        for (n5 = 0; n5 <= 2000; n5++) {
            ll sum2 = sum + n5 * 5000;
            if (sum2 > y) continue;
            ll d2 = y - sum2, m2 = n - n10 - n5;
            if (d2 > m2 * 1000) continue;

            for (n1 = 0; n1 <= 2000; n1++) {
                ll sum3 = sum2 + n1 * 1000;
                if (sum3 == y && n10 + n5 + n1 == n) { cout << n10 << " " << n5 << " " << n1 << endl; exit(0); }
            }
        }
    }

//    n1 = y / 1000;
//    while (n1 + n5 + n10 > n) {
//        pr_vars(n1, n5, n10);
//        if (n1 >= 5) { n1 -= 5; n5++; }
//        else break;
//    }
//    while (n1 + n5 + n10 > n) {
//        ll d = n1 + n5 - n;
//        pr_vars(d, n1, n5, n10);
//        if (d >= 10 && n1 >= 10) { n10++; n1 -= 10; }
//        else if (d >= 6 && n1 >= 5 && n5 >= 1) { n10++; n5 -= 1; n1 -= 5; }
//        else if (d >= 2 && n5 >= 2) { n10++; n5 -= 2; }
//        else break;
//    }
//    pr_vars(n1, n5, n10);
//    if (n1 + n5 + n10 == n) cout << n10 << " " << n5 << " " << n1 << endl;
//    else cout << "-1 -1 -1" << endl;

    cout << "-1 -1 -1" << endl;
    return 0;
}


Measured memory_bytes: 256