#include <bits/stdc++.h>

using namespace std;

int main(){
	int n,Y;
	cin>>n>>Y;
	for(int i=0; i<=Y/10000; ++i){
		for(int j=0; j<=Y/5000; ++j){
			int k = n-i-j;	
			if(k>=0&&(i*10000 + j*5000 + k*1000 == Y)){
				cout<<i<<' '<<j<<' '<<k<<endl;
				return 0;
			}
		}
	}	
	cout<<"-1 -1 -1"<<endl;
	return 0;
}