object Main extends App{
  val sc = new java.util.Scanner(System.in)
  var n = sc.nextDouble()
  var k = sc.nextDouble
  var a = Array.fill(n.asInstanceOf[Int])(sc.nextDouble)
  var b = Array.fill(n.asInstanceOf[Int])(0.0)
  var bb = Array.fill(n.asInstanceOf[Int])(0.0)
  var ka,kb = 0.0
  for (i <- 0 until k.asInstanceOf[Int]){
    for (j <- 1 to n.asInstanceOf[Int]){
      ka = j - a(j-1) - 0.5
      kb = j + a(j-1) + 0.5
      for (kk <- (ka.asInstanceOf[Int] + 1) to kb.asInstanceOf[Int] if kk > 0 & kk <= 5){
        b(kk-1) += 1
      }
    }
    if (a==b){
      for (ii <- 0 until n.asInstanceOf[Int]){
        print(a(ii).asInstanceOf[Int])
        print(" ")
        sys.exit()
      }
    }
    System.arraycopy(b,0,a,0,a.length)
    b = Array.fill(n.asInstanceOf[Int])(0.0)
  }
  for (i <- 0 until n.asInstanceOf[Int]){
    print(a(i).asInstanceOf[Int])
    print(" ")
  }
}
