function spilitInput(input) {
  var splited = [];
  var rows = input.split('\n');
  for (var i = 0; i < rows.length; i += 1) {
    splited.push(rows[i].split(' '));
  }
  return splited;
}
function Main(input) {
  var splited = spilitInput(input);
  var N = splited[0][0];
  var Y = splited[0][1];
  var ax = 10000;
  var ay = 5000;
  var az = 1000;
  var x = -1;
  var y = -1;
  var z = -1;
  var hit = false;
  
  for(var iz = 0; iz <= N && !hit; iz += 1) {
  for(var iy = 0; iy <= N && !hit; iy += 1) {
    var ix = N - iz - iy;
    var total = (ax*ix)+(ay*iy)+(az*iz);
    if (total == Y) {
      x = ix;
      y = iy;
      z = iz;
      hit = true;
    }
  }
  }
  console.log(x+' '+y+' '+z);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));