#include <iostream>
using namespace std;

int main(){
	int N,Y,i=0,j=0,w=0;

	cin >> N >> Y;

	for(i=0;i<=N;i++){
		for(j=0;j<=N-i;j++){
			if(9000*i+4000*j+N*1000==Y){
				w++;
				cout << i << " " << j << " " << N-i-j;
				break;
			}
		}
		if(w!=0) break;
	}
				
	if(w==0) cout << "-1 -1 -1";
}
