function Main(input) {
  "use strict";
  const lines = input.split("\n");
  const l1 = lines[0].split(" ").map(n => parseInt(n, 10))
  const N = l1[0]
  const Y = l1[1]

  var r10000  = -1, r5000 = -1, r1000 = -1;

  for (var a = 0; a <= N; a++) {
    for (var b = 0; a+b <= N; b++) {
      var c = N  - a - b
      var total = 10000*a + 5000*b + 1000*c;
      if (total === Y) {
        r10000 = a
        r5000 = b
        r1000 = c
        break;
      }
    
    }
  }
  console.log("" + r10000 + " " + r5000 + " " + r1000)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
