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

func main() {
    let line = readInts()
    let N = line[0]
    let Y = line[1]
    
    for i in 0...N {
        for j in 0...(N - i) {
            let k = N - i - j
            if 10000 * i + 5000 * j + 1000 * k == Y {
                print(i, j, k)
                return
            }
        }
    }
    
    print("-1 -1 -1")
}

main()
