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

S = input()



dp = [-1] * (N + M + 1)

dp[N] = 0

pos = N



while pos > 0:

    dist = dp[pos]

    tmp = pos



    for i in range(1, M + 1):

        if pos - i < 0:

            break

        if S[pos - i] == "0":

            dp[pos - i] = dist + 1

            tmp = pos - i

    if pos == tmp:

        break

    pos = tmp



if dp[0] == -1:

    print(-1)

    exit()



ans = []

cnt = dp[0]

pos = 0

while cnt > 0:

    for i in range(1, M + 1):

        if dp[pos + i] + 1 == cnt:

            ans.append(i)

            pos += i

            cnt -= 1

            break



print(*ans, sep=" ")

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

S = eval(input())

S = S[::-1]



dp = [-1] * (N+1)

dp[0] = 0



pos = 0

while pos < N:



    p = pos

    update = False



    for i in range(1, M + 1):

        if p + i > N:

            break

        if S[p + i] == "0":

            update = True

            pos = p + i

            dp[pos] = dp[p] + 1



    if not update:

        break



if dp[N] == -1:

    print((-1))

    exit()



dp = dp[::-1]

num = dp[0]

ans = []

pos = 0



while num > 0:

    for i in range(1, M + 1):

        if dp[pos + i] == num - 1:

            num -= 1

            pos += i

            ans.append(str(i))

            break



ans = " ".join(ans)

print(ans)

N, M = map(int, input().split())
S = input()
dp = [-1] * (N + M + 1)
dp[N] = 0
pos = N
while pos > 0:
    dist = dp[pos]
    tmp = pos
    for i in range(1, M + 1):
        if pos - i < 0:
            break
        if S[pos - i] == "0":
            dp[pos - i] = dist + 1
            tmp = pos - i
    if pos == tmp:
        break
    pos = tmp
if dp[0] == -1:
    print(-1)
    exit()
ans = []
cnt = dp[0]
pos = 0
while cnt > 0:
    for i in range(1, M + 1):
        if dp[pos + i] + 1 == cnt:
            ans.append(i)
            pos += i
            cnt -= 1
            break
print(*ans, sep=" ")

N, M = list(map(int, input().split()))
S = eval(input())
S = S[::-1]
dp = [-1] * (N + 1)
dp[0] = 0
pos = 0
while pos < N:
    p = pos
    update = False
    for i in range(1, M + 1):
        if p + i > N:
            break
        if S[p + i] == "0":
            update = True
            pos = p + i
            dp[pos] = dp[p] + 1
    if not update:
        break
if dp[N] == -1:
    print((-1))
    exit()
dp = dp[::-1]
num = dp[0]
ans = []
pos = 0
while num > 0:
    for i in range(1, M + 1):
        if dp[pos + i] == num - 1:
            num -= 1
            pos += i
            ans.append(str(i))
            break
ans = " ".join(ans)
print(ans)

-N, M = map(int, input().split()) -S = input() -dp = [-1] * (N + M + 1) -dp[N] = 0 -pos = N -while pos > 0: -    dist = dp[pos] -    tmp = pos +N, M = list(map(int, input().split())) +S = eval(input()) +S = S[::-1] +dp = [-1] * (N + 1) +dp[0] = 0 +pos = 0 +while pos < N: +    p = pos +    update = False -        if pos - i < 0: +        if p + i > N: -        if S[pos - i] == "0": -            dp[pos - i] = dist + 1 -            tmp = pos - i -    if pos == tmp: +        if S[p + i] == "0": +            update = True +            pos = p + i +            dp[pos] = dp[p] + 1 +    if not update: -    pos = tmp -if dp[0] == -1: -    print(-1) +if dp[N] == -1: +    print((-1)) +dp = dp[::-1] +num = dp[0] -cnt = dp[0] -while cnt > 0: +while num > 0: -        if dp[pos + i] + 1 == cnt: -            ans.append(i) +        if dp[pos + i] == num - 1: +            num -= 1 -            cnt -= 1 +            ans.append(str(i)) -print(*ans, sep=" ") +ans = " ".join(ans) +print(ans)