object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt()
  val Y = sc.nextInt() / 1000
  val patterns = for {
    x <- 0 to N
    y <- 0 to N
    z = N - x - y
    if 0 <= z
    if x * 10 + y * 5 + z == Y
  } yield Seq(x, y, z)
  println(if (patterns.isEmpty) "-1 -1 -1" else patterns.head.mkString(" "))
}
