import sys

input = sys.stdin.readline



n, m = [int(x) for x in input().split()]

s = input().rstrip()

s_rev = s[::-1]



place = 0



ans = []



while place < n:

    flag = 1

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

        if s_rev[place + i] == "0":

            ans.append(i)

            place += i

            flag = 0

            break

    if flag:

        print((-1))

        sys.exit()



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

import sys

input = lambda: sys.stdin.readline().rstrip()

 

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

s = eval(input())

ans = []

s = s[::-1]

now = 0

while True:

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

        if i == 0:

            print((-1))

            sys.exit()

        if now + i <= n and s[now + i] == "0":

            now += i

            ans.append(i)

            if now == n:

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

                sys.exit()

            else:

                break

    

        

import sys

input = sys.stdin.readline
n, m = [int(x) for x in input().split()]
s = input().rstrip()
s_rev = s[::-1]
place = 0
ans = []
while place < n:
    flag = 1
    for i in range(min(m, n - place), 0, -1):
        if s_rev[place + i] == "0":
            ans.append(i)
            place += i
            flag = 0
            break
    if flag:
        print((-1))
        sys.exit()
print((*ans[::-1]))

import sys

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

-input = sys.stdin.readline -n, m = [int(x) for x in input().split()] -s = input().rstrip() -s_rev = s[::-1] -place = 0 +input = lambda: sys.stdin.readline().rstrip() +n, m = list(map(int, input().split())) +s = eval(input()) -while place < n: -    flag = 1 -    for i in range(min(m, n - place), 0, -1): -        if s_rev[place + i] == "0": +s = s[::-1] +now = 0 +while True: +    for i in range(m, -1, -1): +        if i == 0: +            print((-1)) +            sys.exit() +        if now + i <= n and s[now + i] == "0": +            now += i -            place += i -            flag = 0 -            break -    if flag: -        print((-1)) -        sys.exit() -print((*ans[::-1])) +            if now == n: +                print((*ans[::-1])) +                sys.exit() +            else: +                break