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

func main() {
    let line = readInts()
    let count = line[0]
    let amount = line[1]
    for a in 0...count {
        for b in 0...(count - a)  {
            if (a * 10000) + (b * 5000) + ((count - a - b) * 1000) == amount {
                print("\(a) \(b) \(count - a - b)")
                return
            }
        }
    }
    print("-1 -1 -1")
}

main()
