N, K = map(int, input().split()) S = list(input()) S = list(map(int, S)) ans = [[], [], []] ans[0] = S for i in range(2): for j in range(len(ans[i]) - 1): ans[i + 1].append(1 - (ans[i][j]&ans[i][j+1])) N -= K + 1 if N % 2 == 0: d = N // 2 print(*ans[1][d:len(ans[1])-d], sep="") else: d = N // 2 print(*ans[2][d:len(ans[2])-d], sep="")