from heapq import heappush, heappop

N, M = list(map(int, input().split()))

s = eval(input())

INF = 10**18

dp_cnt = [INF]*(N+1)

dp_next = [0]*(N+1)

dp_cnt[N] = 0

q = [(0,N)]



for i in range(N-1, -1, -1):

  while True:

    cnt, j = q[0]

    if j-i>M:

      heappop(q)

    else:

      break

  dp_cnt[i] = cnt

  if s[i]=='1':

    cnt = INF

    j = 0

  cnt += 1

  heappush(q, (cnt, i))

  dp_next[i] = j



if dp_cnt[0]>=INF:

  print((-1))

  exit()



x = 0

ans = []

while x<N:

  y = dp_next[x]

  ans += [str(y-x)]

  x = y



print((*ans))
from heapq import heappush, heappop

N, M = list(map(int, input().split()))

s = eval(input())

q = [(0,N)]

INF = 10**9

dic = {}

for i in range(N-1, -1, -1):

  cnt, j = q[0]

  while j-i>M:

    heappop(q)

    cnt, j = q[0]

  heappush(q, (cnt,j))

  cnt += 1 if s[i]!='1' else INF

  heappush(q, (cnt,i))

  dic[i] = j



if cnt>=INF:

  print((-1))

else:

  x = 0

  while x!=N:

    y = dic[x]

    print((y-x))

    x = y
from heapq import heappush, heappop

N, M = list(map(int, input().split()))
s = eval(input())
INF = 10**18
dp_cnt = [INF] * (N + 1)
dp_next = [0] * (N + 1)
dp_cnt[N] = 0
q = [(0, N)]
for i in range(N - 1, -1, -1):
    while True:
        cnt, j = q[0]
        if j - i > M:
            heappop(q)
        else:
            break
    dp_cnt[i] = cnt
    if s[i] == "1":
        cnt = INF
        j = 0
    cnt += 1
    heappush(q, (cnt, i))
    dp_next[i] = j
if dp_cnt[0] >= INF:
    print((-1))
    exit()
x = 0
ans = []
while x < N:
    y = dp_next[x]
    ans += [str(y - x)]
    x = y
print((*ans))

from heapq import heappush, heappop

N, M = list(map(int, input().split()))
s = eval(input())
q = [(0, N)]
INF = 10**9
dic = {}
for i in range(N - 1, -1, -1):
    cnt, j = q[0]
    while j - i > M:
        heappop(q)
        cnt, j = q[0]
    heappush(q, (cnt, j))
    cnt += 1 if s[i] != "1" else INF
    heappush(q, (cnt, i))
    dic[i] = j
if cnt >= INF:
    print((-1))
else:
    x = 0
    while x != N:
        y = dic[x]
        print((y - x))
        x = y

-INF = 10**18 -dp_cnt = [INF] * (N + 1) -dp_next = [0] * (N + 1) -dp_cnt[N] = 0 +INF = 10**9 +dic = {} -    while True: +    cnt, j = q[0] +    while j - i > M: +        heappop(q) -        if j - i > M: -            heappop(q) -        else: -            break -    dp_cnt[i] = cnt -    if s[i] == "1": -        cnt = INF -        j = 0 -    cnt += 1 +    heappush(q, (cnt, j)) +    cnt += 1 if s[i] != "1" else INF -    dp_next[i] = j -if dp_cnt[0] >= INF: +    dic[i] = j +if cnt >= INF: -    exit() -x = 0 -ans = [] -while x < N: -    y = dp_next[x] -    ans += [str(y - x)] -    x = y -print((*ans)) +else: +    x = 0 +    while x != N: +        y = dic[x] +        print((y - x)) +        x = y