
open Scanf
open Printf

let flip f x y = f y x

let rec range a b = if a >= b then [] else a :: range (a+1) b

let read_int () = scanf " %d" (fun x -> x)
let rec read_ints n = if n = 0 then [] else let i = read_int () in i :: read_ints (n-1)

let solve n y =
  let rec f j k = 
    let price = 10000 * j + 5000 * k + 1000 * (n - j - k) in
    if price = y then (j, k, n-j-k)
    else if price < y && j + k < n then f j (k+1)
    else if j < n then f (j+1) 0
    else (-1, -1, -1) in
  f 0 0

let () =
  let n = read_int () in let y = read_int () in
  let a, b, c = solve n y in
  printf "%d %d %d\n" a b c
