func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let ints = readInts()
let n = ints[0]
let sum = ints[1]

func main() {
    for i in 0...n {
        for j in 0...(n - i) {
            for k in 0...(n - i - j) {
                if i * 10_000 + j * 5_000 + k * 1_000 == sum && i + j + k == n {
                    print("\(i) \(j) \(k)")
                    return
                }
            }
        }
    }
    print("-1 -1 -1")
}

main()