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

S = eval(input())

N0 = 2**(N-1).bit_length()

INF = 2**31-1



# k番目の要素をxに更新

def update(k, x, data):

    k += N0-1

    data[k] = x

    while k >= 0:

        k = (k - 1) // 2

        data[k] = min(data[2*k+1], data[2*k+2])



# [l,r)の最小値

def query(l, r, data):

    L = l + N0; R = r + N0

    s = INF

    while L < R:

        if R & 1:

            R -= 1

            s = min(s, data[R-1])



        if L & 1:

            s = min(s, data[L-1])

            L += 1

        L >>= 1; R >>= 1

    return s







data1 = [INF]*(3*N0)

update(0,0,data1)

for n in range(N):

    if S[n+1]=='0':

        update(n+1,query(max(0,n-M+1),n+1,data1)+1,data1)



S = S[::-1]

data2 = [INF]*(3*N0)

update(0,0,data2)

for n in range(N):

    if S[n+1]=='0':

        update(n+1,query(max(0,n-M+1),n+1,data2)+1,data2)



cost1 = [INF]*(N+1)

cost2 = [INF]*(N+1)

for n in range(N+1):

    cost1[n] = query(n,n+1,data1)

    cost2[n] = query(N-n,N-n+1,data2)



ans = []

cost = 0

for n in range(N+1):

    if cost != cost1[n] and cost1[n]+cost2[n]==cost1[N]:

        ans.append(n)

        cost = cost1[n]

ans = [0]+ans

for i in range(len(ans)-2,-1,-1):

    ans[i+1] = ans[i+1]-ans[i]



ans = ' '.join([str(c) for c in ans[1:]])

if cost2[0]==INF:

    ans = '-1'

print(ans)

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

S = eval(input())

S = S[::-1]

s = 0

used = [0]

while s < N:

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

        if s+i > N:

            i = N-s

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

            s += i

            used.append(s)

            break

    if i==0:

        break

if s==N:

    ans = []

    for i in range(len(used)-1):

        ans.append(used[i+1]-used[i])

    ans = ans[::-1]

    ans = ' '.join([str(c) for c in ans])

    print(ans)

else:

    print((-1))
N, M = list(map(int, input().split()))
S = eval(input())
N0 = 2 ** (N - 1).bit_length()
INF = 2**31 - 1
# k番目の要素をxに更新
def update(k, x, data):
    k += N0 - 1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = min(data[2 * k + 1], data[2 * k + 2])


# [l,r)の最小値
def query(l, r, data):
    L = l + N0
    R = r + N0
    s = INF
    while L < R:
        if R & 1:
            R -= 1
            s = min(s, data[R - 1])
        if L & 1:
            s = min(s, data[L - 1])
            L += 1
        L >>= 1
        R >>= 1
    return s


data1 = [INF] * (3 * N0)
update(0, 0, data1)
for n in range(N):
    if S[n + 1] == "0":
        update(n + 1, query(max(0, n - M + 1), n + 1, data1) + 1, data1)
S = S[::-1]
data2 = [INF] * (3 * N0)
update(0, 0, data2)
for n in range(N):
    if S[n + 1] == "0":
        update(n + 1, query(max(0, n - M + 1), n + 1, data2) + 1, data2)
cost1 = [INF] * (N + 1)
cost2 = [INF] * (N + 1)
for n in range(N + 1):
    cost1[n] = query(n, n + 1, data1)
    cost2[n] = query(N - n, N - n + 1, data2)
ans = []
cost = 0
for n in range(N + 1):
    if cost != cost1[n] and cost1[n] + cost2[n] == cost1[N]:
        ans.append(n)
        cost = cost1[n]
ans = [0] + ans
for i in range(len(ans) - 2, -1, -1):
    ans[i + 1] = ans[i + 1] - ans[i]
ans = " ".join([str(c) for c in ans[1:]])
if cost2[0] == INF:
    ans = "-1"
print(ans)

N, M = list(map(int, input().split()))
S = eval(input())
S = S[::-1]
s = 0
used = [0]
while s < N:
    for i in range(M, -1, -1):
        if s + i > N:
            i = N - s
        if S[s + i] == "0":
            s += i
            used.append(s)
            break
    if i == 0:
        break
if s == N:
    ans = []
    for i in range(len(used) - 1):
        ans.append(used[i + 1] - used[i])
    ans = ans[::-1]
    ans = " ".join([str(c) for c in ans])
    print(ans)
else:
    print((-1))

-N0 = 2 ** (N - 1).bit_length() -INF = 2**31 - 1 -# k番目の要素をxに更新 -def update(k, x, data): -    k += N0 - 1 -    data[k] = x -    while k >= 0: -        k = (k - 1) // 2 -        data[k] = min(data[2 * k + 1], data[2 * k + 2]) - - -# [l,r)の最小値 -def query(l, r, data): -    L = l + N0 -    R = r + N0 -    s = INF -    while L < R: -        if R & 1: -            R -= 1 -            s = min(s, data[R - 1]) -        if L & 1: -            s = min(s, data[L - 1]) -            L += 1 -        L >>= 1 -        R >>= 1 -    return s - - -data1 = [INF] * (3 * N0) -update(0, 0, data1) -for n in range(N): -    if S[n + 1] == "0": -        update(n + 1, query(max(0, n - M + 1), n + 1, data1) + 1, data1) -data2 = [INF] * (3 * N0) -update(0, 0, data2) -for n in range(N): -    if S[n + 1] == "0": -        update(n + 1, query(max(0, n - M + 1), n + 1, data2) + 1, data2) -cost1 = [INF] * (N + 1) -cost2 = [INF] * (N + 1) -for n in range(N + 1): -    cost1[n] = query(n, n + 1, data1) -    cost2[n] = query(N - n, N - n + 1, data2) -ans = [] -cost = 0 -for n in range(N + 1): -    if cost != cost1[n] and cost1[n] + cost2[n] == cost1[N]: -        ans.append(n) -        cost = cost1[n] -ans = [0] + ans -for i in range(len(ans) - 2, -1, -1): -    ans[i + 1] = ans[i + 1] - ans[i] -ans = " ".join([str(c) for c in ans[1:]]) -if cost2[0] == INF: -    ans = "-1" -print(ans) +s = 0 +used = [0] +while s < N: +    for i in range(M, -1, -1): +        if s + i > N: +            i = N - s +        if S[s + i] == "0": +            s += i +            used.append(s) +            break +    if i == 0: +        break +if s == N: +    ans = [] +    for i in range(len(used) - 1): +        ans.append(used[i + 1] - used[i]) +    ans = ans[::-1] +    ans = " ".join([str(c) for c in ans]) +    print(ans) +else: +    print((-1))