n,m=list(map(int,input().split()))

su=eval(input())

rev=su[::-1]

if "1"*m in su:

	print((-1))

	exit()

dist_f_n=[float('inf')]*(n+1)

dist_f_n[0]=0

for i in range(1,m+1):

	if rev[i]=="0":

		dist_f_n[i]=1

		last=i

		if i==n:

			break

while last<n:

	for i in range(last+1,last+m+1):

		if rev[i]=="0":

			dist_f_n[i]=dist_f_n[last]+1

			_last=i

			if i==n:

				break

	last=_last

cur=dist_f_n[-1]

_i=0

ans=[]

for i,x in enumerate(dist_f_n[::-1]):

	if x==cur-1:

		ans.append(i-_i)

		cur-=1

		_i=i

print((" ".join(map(str,ans))))

def main():

	n, m = list(map(int, input().split()))

	rev = input()[::-1]

	ans = []

	cur = nxt = 0

	while cur < n:

		for i in range(cur + 1, cur + m + 1):

			if i==n:

				nxt = i

				break

			if rev[i]=="0":

				nxt = i

		if cur==nxt:

			print((-1))

			exit()

		ans += [str(nxt - cur)]

		cur = nxt

	print((" ".join(ans[::-1])))





if __name__=="__main__":

	main()

n, m = list(map(int, input().split()))
su = eval(input())
rev = su[::-1]
if "1" * m in su:
    print((-1))
    exit()
dist_f_n = [float("inf")] * (n + 1)
dist_f_n[0] = 0
for i in range(1, m + 1):
    if rev[i] == "0":
        dist_f_n[i] = 1
        last = i
        if i == n:
            break
while last < n:
    for i in range(last + 1, last + m + 1):
        if rev[i] == "0":
            dist_f_n[i] = dist_f_n[last] + 1
            _last = i
            if i == n:
                break
    last = _last
cur = dist_f_n[-1]
_i = 0
ans = []
for i, x in enumerate(dist_f_n[::-1]):
    if x == cur - 1:
        ans.append(i - _i)
        cur -= 1
        _i = i
print((" ".join(map(str, ans))))

def main():
    n, m = list(map(int, input().split()))
    rev = input()[::-1]
    ans = []
    cur = nxt = 0
    while cur < n:
        for i in range(cur + 1, cur + m + 1):
            if i == n:
                nxt = i
                break
            if rev[i] == "0":
                nxt = i
        if cur == nxt:
            print((-1))
            exit()
        ans += [str(nxt - cur)]
        cur = nxt
    print((" ".join(ans[::-1])))


if __name__ == "__main__":
    main()

-n, m = list(map(int, input().split())) -su = eval(input()) -rev = su[::-1] -if "1" * m in su: -    print((-1)) -    exit() -dist_f_n = [float("inf")] * (n + 1) -dist_f_n[0] = 0 -for i in range(1, m + 1): -    if rev[i] == "0": -        dist_f_n[i] = 1 -        last = i -        if i == n: -            break -while last < n: -    for i in range(last + 1, last + m + 1): -        if rev[i] == "0": -            dist_f_n[i] = dist_f_n[last] + 1 -            _last = i +def main(): +    n, m = list(map(int, input().split())) +    rev = input()[::-1] +    ans = [] +    cur = nxt = 0 +    while cur < n: +        for i in range(cur + 1, cur + m + 1): +                nxt = i -    last = _last -cur = dist_f_n[-1] -_i = 0 -ans = [] -for i, x in enumerate(dist_f_n[::-1]): -    if x == cur - 1: -        ans.append(i - _i) -        cur -= 1 -        _i = i -print((" ".join(map(str, ans)))) +            if rev[i] == "0": +                nxt = i +        if cur == nxt: +            print((-1)) +            exit() +        ans += [str(nxt - cur)] +        cur = nxt +    print((" ".join(ans[::-1]))) + + +if __name__ == "__main__": +    main()