fun main (args: Array<String>) {
	
	val list = readLine()!!.split(" ").map(String::toInt)
	
	var j : Int
	var money : Int
	
	var num1 : Int = -1
	var num2 : Int = -1
	var num3 : Int = -1
	
	
	for (h in 0..list[0]) {
		for (i in 0..(list[0] - h)) {
			j = list[0] - h - i
			money = (10000 * h) + (5000 * i) + (1000 * j)
			if (money == list[1]) {
				num1 = h
				num2 = i
				num3 = j
				return println("${num1} ${num2} ${num3}")
			}
		}
		
	}
	
	println("${num1} ${num2} ${num3}")
	
}