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 bisect import bisect_left

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

s = eval(input())

safe = []

out = []

cnt = 0

for i, m in enumerate(s):

  if m=='1':

    out += [i]

    cnt += 1

    if cnt==M:

      print((-1))

      break

  else:

    safe += [i]

    cnt = 0

else:

  ps = N

  ans = []

  while ps!=0:

    ind = bisect_left(safe,ps-M)

    ans += [ps-safe[ind]]

    ps = safe[ind]

  print((*ans[::-1]))

    
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 bisect import bisect_left

N, M = list(map(int, input().split()))
s = eval(input())
safe = []
out = []
cnt = 0
for i, m in enumerate(s):
    if m == "1":
        out += [i]
        cnt += 1
        if cnt == M:
            print((-1))
            break
    else:
        safe += [i]
        cnt = 0
else:
    ps = N
    ans = []
    while ps != 0:
        ind = bisect_left(safe, ps - M)
        ans += [ps - safe[ind]]
        ps = safe[ind]
    print((*ans[::-1]))

-from heapq import heappush, heappop +from bisect import bisect_left -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)) +safe = [] +out = [] +cnt = 0 +for i, m in enumerate(s): +    if m == "1": +        out += [i] +        cnt += 1 +        if cnt == M: +            print((-1)) +            break +    else: +        safe += [i] +        cnt = 0 -    x = 0 -    while x != N: -        y = dic[x] -        print((y - x)) -        x = y +    ps = N +    ans = [] +    while ps != 0: +        ind = bisect_left(safe, ps - M) +        ans += [ps - safe[ind]] +        ps = safe[ind] +    print((*ans[::-1]))