#include<bits/stdc++.h>
using namespace std;
int main() {
	int N,Y,x,y,z,f=0;
	cin>>N>>Y;
	Y/=1000;
	x=0; y=(Y-Y%5)/5;z=Y%5;
	while(x+y+z>N){x++; y-=2;}
	while(x+y+z<N){x--; y+=2;}
	while(x<0||z<0){x+=4; z+=5; y-=9;}
	if(x+y+z!=N||10*x+5*y+z!=Y||x<0||y<0||z<0)x=y=z=-1;
	cout<<x<<" "<<y<<" "<<z<<endl;
	return 0;
}
