#include <bits/stdc++.h>

using namespace std;

int main(){
	int n, x;
	cin >> n >> x;
	for (int i = 0; i <= n; i++){
		for (int j = 0; j <= n - i; j++){
			if (i * 10000 + j * 5000 + (n - i - j) * 1000 == x){
				cout << i << " " << j << " " << n - i - j << "\n";
				return 0;
			}
		}
	}
	cout << "-1 -1 -1\n";
}