#include<stdio.h>
int main(){
int N,Y,a,b,c;
scanf("%d %d",&N,&Y);
for(a=0;a<=N;a++){
for(b=0;b<=(N-a);b++){
c=N-(a+b);
if(a*10000+b*5000+c*1000==Y){
printf("%d %d %d",a,b,c);
return 0;
}
}}
printf("%d %d %d",-1,-1,-1);
return 0;

}