#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n,y;
cin>>n>>y;
y=y/1000;
int a,b,c;
a=b=c=-1;
for(int i=0;10*i<=y;i++){
int z=(y-10*i)/5;
for(int j=0;j<=z;j++){
int k=y-10*i-5*j;
if(i+j+k==n){
a=k;
b=j;
c=i;
break;
}
}
}
cout <<c<<" "<<b<<" "<<a<<endl;
return 0;
}