def F(S): T = [] for i in range(len(S) - 1): if S[i] == S[i+1] == 1: T.append(0) else: T.append(1) return T N, K = map(int, input().split()) S = list(map(int, input())) X = F(S) Y = F(X) if K == N - 1: print(*X, sep="") exit() if K == N - 2: print(*Y, sep="") exit() if (N - K) % 2 == 0: d = (N - K - 2) // 2 print(*Y[d:-d], sep="") else: d = (N - K - 1) // 2 print(*X[d:-d], sep="")