"use strict"
function Main(input) {
  input = input.trim().split(' ').map(Number);
  let N = input[0];
  let Y = input[1];

  const h = 1e4;
  const m = 5e3;
  const l = 1e3;

  let rx = -1;
  let ry = -1;
  let rz = -1;
  for(let x=0; x<=N; ++x){
    for(let y=0; y<=N-x; ++y){
      let lz = (N-x-y)*l;
      let total = h*x + m*y + lz;
      if(total === Y) {
        rx = x;
        ry = y;
        rz = N-x-y;
      }
    }
  }


  console.log(rx,ry,rz);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));