// ABC 085

// inputに入力データ全体が入る
function Main(input) {
  input = input.split(" ");
  const N = input[0]; //枚数
  const Y = input[1]; //金額
  var result = "-1 -1 -1";

  for(var a=0;a<N;a++) {
    for (var b=0;b<N;b++) {
      for(var c=0;c<N;c++) {
        var sum_money = a*10000 + b*5000 + c*1000;
        var sum_count = a + b + c;
        if(Y == sum_money && N == sum_count) {
          result = a + " " + b + " " + c + " ";
        }
      }
    }
  }
  console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
