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

s=eval(input())

ans=[]

cursor=n

actualfail=0

while cursor!=0:

  if cursor<=m:

    ans.append(cursor)

    break

  failflag=1

  for i in range(m):

    if s[cursor-m+i]=='0':

      failflag=0

      ans.append(m-i)

      cursor-=m-i

      break

  if failflag==1:

    actualfail=1

    break

if actualfail==1:

  print((-1))

else:

  ans.reverse()

  for i in ans:

    print(i)
import sys

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

s=eval(input())

ans=[]

current=n

while current>0:

  for i in range(m):

    if current-(m-i)<0:

      continue

    if s[current-(m-i)]=='0':

      current-=(m-i)

      ans.append(str(m-i))

      break

    if i==m-1:

      print((-1))

      sys.exit()

ans.reverse()

print((' '.join(ans)))
n, m = list(map(int, input().split()))
s = eval(input())
ans = []
cursor = n
actualfail = 0
while cursor != 0:
    if cursor <= m:
        ans.append(cursor)
        break
    failflag = 1
    for i in range(m):
        if s[cursor - m + i] == "0":
            failflag = 0
            ans.append(m - i)
            cursor -= m - i
            break
    if failflag == 1:
        actualfail = 1
        break
if actualfail == 1:
    print((-1))
else:
    ans.reverse()
    for i in ans:
        print(i)

import sys

n, m = list(map(int, input().split()))
s = eval(input())
ans = []
current = n
while current > 0:
    for i in range(m):
        if current - (m - i) < 0:
            continue
        if s[current - (m - i)] == "0":
            current -= m - i
            ans.append(str(m - i))
            break
        if i == m - 1:
            print((-1))
            sys.exit()
ans.reverse()
print((" ".join(ans)))

+import sys + -cursor = n -actualfail = 0 -while cursor != 0: -    if cursor <= m: -        ans.append(cursor) -        break -    failflag = 1 +current = n +while current > 0: -        if s[cursor - m + i] == "0": -            failflag = 0 -            ans.append(m - i) -            cursor -= m - i +        if current - (m - i) < 0: +            continue +        if s[current - (m - i)] == "0": +            current -= m - i +            ans.append(str(m - i)) -    if failflag == 1: -        actualfail = 1 -        break -if actualfail == 1: -    print((-1)) -else: -    ans.reverse() -    for i in ans: -        print(i) +        if i == m - 1: +            print((-1)) +            sys.exit() +ans.reverse() +print((" ".join(ans)))