#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll i,j;
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n,y;
    cin>>n>>y;
    for(i=0;i<=n;i++)
    {
        ll tmp=i*10000;
        for(j=0;j<=n;j++)
        {
            ll tmp2=tmp+j*5000;
            ll tmp3=y-tmp2;
            if(tmp3>=0 && tmp3%1000==0)
            {
                ll k=tmp3/1000;
                cout<<i<<" "<<j<<" "<<k<<endl;
                return 0;
            }
        }
    }
    cout<<-1<<" "<<-1<<" "<<-1<<endl;
}

