(ns Atcoder.ABC085-C)

(defn otoshidama [n y]
  (for [a (range 0 (+ n 1)) b (range (- (+ n 1) a))
        :let [c (- n a b)]
        :when (= (+ (* 10000 a) (* 5000 b) (* 1000 c)) y)
        ]
    (format "%d" "%d" "%d" a b c)))

(defn solve []
  (let [res (first (otoshidama (read) (read)))]
    (if (nil? res)
      (println "-1 -1 -1")
      (println res))))


(solve)