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;
  
  x = (Y / ax);
  Y = (Y - (ax * x));
  
  y = (Y / ay);
  Y = (Y - (ay * y));
  
  z = (Y / az);
  Y = (Y - (az * z));
  
  if (Y == 0) {
    console.log(x+' '+y+' '+z);
  } else {
    console.log('-1 -1 -1');
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));