""" 111011100 1101110 10111 011 1 """ import sys from collections import deque N,K = map(int,input().split()) S = list(map(int,list(input()))) for i in range(min(N-K,2)): T = [ (S[i]&S[i+1])^1 for i in range(len(S)-1) ] S = T if len(S) == K: print (*S,sep="") sys.exit() S = deque(S) while len(S) > K+1: S.pop() S.popleft() S = list(S) while len(S) > K: T = [ (S[i]&S[i+1])^1 for i in range(len(S)-1) ] S = T print (*S,sep="")