object Main extends App {
	val ny = scala.io.StdIn.readLine.split(" ").map(_.toLong)

	val temp = ny(1)/1000 - ny(0)
	var ans = List[(Long, Long, Long)]()

	if(temp == 0) println(s"0 0 $ny(0)")
	else {
		var i = 0L
		while(temp - 4*i >= 0){
			if((temp - 4*i) % 9 == 0){
				val x = (temp - 4*i)/9
				val y = i
				val z = ny(0) - x - y
				if(x>=0 && y>=0 && z>=0) ans = (x,y,z) :: ans
			}
			i += 1
		}
	}

	if(ans.size == 0) println("-1 -1 -1")
	else {
		ans.head match {
			case (a,b,c) => println(s"$a $b $c")
			case _ =>  
		}
	}

}
