"use strict";

function Main(input) {
  input = input.split(" ");
  input[0] = parseInt(input[0]);
  input[1] = parseInt(input[1]);

  // const counter = [0, 0, 0];

  for (let counter1 = 0; counter1 < input[0]; counter1++) {
    if (counter1 * 10000 > input[1]) {
      break;
    }
    for (let counter2 = 0; counter2 < input[0]; counter2++) {
      if (counter1 * 10000 + counter2 * 5000 > input[1]) {
        break;
      }
      for (let counter3 = 0; counter3 < input[0]; counter3++) {
        if (
          counter1 + counter2 + counter3 === input[0] &&
          counter1 * 10000 + counter2 * 5000 + counter3 * 1000 === input[1]
        ) {
          console.log(counter1, counter2, counter3);
          return;
        }
      }
    }
  }
  console.log(-1, -1, -1);
}

Main(require("fs").readFileSync("/dev/stdin", "utf-8"));
