import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List
import Data.Array

main = do
  li <- BS.getLine
  let [n,k] = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  li <- BS.getLine
  let as = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  let ans = compute n k as
  putStrLn $ unwords $ map show ans

compute :: Int -> Int -> [Int] -> [Int]
compute n k as = elems $ iterate (step n) (listArray (1,n) as) !! k

step n ar = accumArray (+) 0 (1,n) [ (j,1) | i <- [1..n], j <- [max 1 (i - ar ! i)..min n (i + ar ! i)] ]
