(defn otoshidama [[N,Y]](if-let [x (first (for [A (range (inc N)) B (range (- (inc N) A)) :let [C (- N A B)] :when (= Y (+(* 10000 A) (* 5000 B) (* 1000 C)))] (format "%d %d %d" A B C)))] x "-1 -1 -1"))
(println (otoshidama (map bigint (.split (read-line) " "))))