import sys

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

s = eval(input())

p = n

hist = []

while p>0:

  for i in range(max(0,p-m), p):

    if s[i]=='0':

      hist.append(p-i)

      p = i

      break

  else:

    print((-1))

    sys.exit()

print((*hist[::-1]))
n, m = list(map(int, input().split()))

s = input()[::-1]

ans = []

now = 0

while now<n:

    for i in range(min(m, n-now), 0, -1):

        if s[now+i]=='0':

            now += i

            ans.append(i)

            break

    else:

        print((-1))

        exit(0)

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

n, m = list(map(int, input().split()))
s = eval(input())
p = n
hist = []
while p > 0:
    for i in range(max(0, p - m), p):
        if s[i] == "0":
            hist.append(p - i)
            p = i
            break
    else:
        print((-1))
        sys.exit()
print((*hist[::-1]))

n, m = list(map(int, input().split()))
s = input()[::-1]
ans = []
now = 0
while now < n:
    for i in range(min(m, n - now), 0, -1):
        if s[now + i] == "0":
            now += i
            ans.append(i)
            break
    else:
        print((-1))
        exit(0)
print((*ans[::-1]))

-import sys - -s = eval(input()) -p = n -hist = [] -while p > 0: -    for i in range(max(0, p - m), p): -        if s[i] == "0": -            hist.append(p - i) -            p = i +s = input()[::-1] +ans = [] +now = 0 +while now < n: +    for i in range(min(m, n - now), 0, -1): +        if s[now + i] == "0": +            now += i +            ans.append(i) -        sys.exit() -print((*hist[::-1])) +        exit(0) +print((*ans[::-1]))