object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt
    val Y = sc.nextLong
    val diff = 10000L * N - Y
    if (diff == 0) {
      println(s"$N 0 0")
      sys.exit
    } else if (diff < 0) {
      println("-1 -1 -1")
      sys.exit
    }
    val z = diff / 9000
    val y = diff % 9000 / 5000
    if (y == 0 && z == 0) {
      println("-1 -1 -1")
      sys.exit
    }
    if (y + z <= N) {
      println(s"${N - y - z} $y $z")
    } else {
      println("-1 -1 -1")
    }
  }
}