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 {
		val a = temp/4
		for(j<-a to 0 by -1){
			if((temp - 4*j)%9 == 0){
				val x = (temp - 4*j)/9
				val y = j
				val z = ny(0) - x - y
				if(z >=0 ) ans = (x,y,z)::ans
			}
		}
	}

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

}