void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int n; long y; rd(n, y);
  
  for(int i=0; i<=n; i++)for(int j=0; i+j<=n; j++){
    auto k=n-(i+j);
    if(10000*i+5000*j+1000*k == y){
      writeln(i, " ", j, " ", k); return;
    }
  }

  writeln(-1, " ", -1, " ", -1);
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}
void wr(T...)(T x){
  import std.stdio;
  foreach(e; x) write(e, " ");
  writeln();
}