import sys def calc(l): ans = [] for i in range(len(l) - 1): ans.append(1 - (l[i] & l[i+1])) return ans N,K = map(int,input().split()) K = N - K S = input() l = list(S) l = list(map(int,l)) if K % 2 == 1: ll = [] for i in range(N - 1): ll.append(1 - (l[i] & l[i+1])) l = ll K -= 1 N -= 1 if K == 0: print(*l,sep = "") exit() if K <= 10 or N <= 10: for _ in range(K): l = calc(l) print(*l,sep = "") exit() u = K // 2 start = u end = N - u - 1 ans = [0] * (N - K) hidari = False migi = False for i in range(u): if l[i] == 0: hidari = True break for i in range(end + 1,N): if l[i] == 0: migi = True break """ if l[start] == 1: if l[u+1] == 1: ans[0] = 1 else: if hidari: ans[0] = 0 else: ans[0] = 1 else: ans[0] = 0 if l[end] == 1: if l[end-1] == 1: ans[-1] = 1 else: if migi: ans[-1] = 0 else: ans[-1] = 1 else: ans[-1] = 0 """ if l[start] == 1: if l[start + 1] == 1: ans[0] = 1 else: if l[start - 1] == 1: ans[0] = 1 else: ans[0] = 0 if l[end] == 1: if l[end - 1] == 0 and l[end] + 1 == 0: ans[-1] = 0 else: ans[-1] = 1 for i in range(1,N - K - 1): if l[start+i] == 0: ans[i] = 0 continue else: if l[start + i - 1] == 0 and l[start + i + 1] == 0: ans[i] = 0 else: ans[i] = 1 print(*ans,sep = "") #print(start,end)