object Main extends App {
  val input=io.Source.stdin.getLines.toIndexedSeq.head.split(' ').map(_.toInt)
  val N=input(0)
  val Y1000=input(1)/1000
  val const=Y1000-N  

  private def func(){
  (0 to const/9).foreach{ a =>
    val b=(const-9*a)/4
    val c=N-a-b
    if(b>=0 && c>=0 && (const-9*a)%4==0) return println(a+" "+b+" "+c)
  }
  println("-1 -1 -1")
  }
  func()
}
