Takahashi is playing a board game called Sugoroku.
On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.
The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.
Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.
Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

-----Constraints-----
 - 1 \leq N \leq 10^5
 - 1 \leq M \leq 10^5
 - |S| = N + 1
 - S consists of 0 and 1.
 - S[0] = 0
 - S[N] = 0

-----Input-----
Input is given from Standard Input in the following format:
N M
S

-----Output-----
If Takahashi can win the game, print the lexicographically smallest sequence among the shortest sequences of numbers coming up in the roulette in which Takahashi can win the game, with spaces in between.
If Takahashi cannot win the game, print -1.

-----Sample Input-----
9 3
0001000100

-----Sample Output-----
1 3 2 3

If the numbers 1, 3, 2, 3 come up in this order, Takahashi can reach Square 9 via Square 1, 4, and 6. He cannot reach Square 9 in three or fewer turns, and this is the lexicographically smallest sequence in which he reaches Square 9 in four turns.

Source: atcoder | Difficulty: MEDIUM_HARD


Solutions:
from bisect import bisect_left
(N, M) = list(map(int, input().split()))
S = input()
good = []
bad = []
for i in range(N + 1):
	if S[i] == '1':
		bad.append(i)
	else:
		good.append(i)
ans = []
cur = N
while True:
	if cur == 0:
		print(' '.join(map(str, ans[::-1])))
		break
	idx = bisect_left(good, cur - M)
	nx = good[idx]
	ans.append(cur - nx)
	if cur == nx:
		print(-1)
		break
	cur = nx


(N, M) = map(int, input().split())
S = list(map(int, reversed(input())))
now = 0
ans = []
while now + M < N:
	last = now
	now += M
	while S[now]:
		now -= 1
	if last == now:
		print(-1)
		break
	ans.append(now - last)
else:
	print(*reversed(ans + [N - now]))


import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
	(N, M) = list(map(int, input().split()))
	S = list(input())
	if S[N] == '1' or S[0] == '1':
		print(-1)
	else:
		ans = []
		now = N
		while now > 0:
			for i in range(M, 0, -1):
				j = max(now - i, -1)
				if j >= 0 and S[j] == '0':
					ans.append(i)
					now = j
					break
				else:
					continue
			else:
				print(-1)
				break
		else:
			print(' '.join(map(str, reversed(ans))))

def __starting_point():
	main()
__starting_point()


import sys
(N, M) = map(int, input().split())
S = input()
S = S[::-1]
i = 0
ans = []
while i < N:
	flag = 0
	for j in range(M, 0, -1):
		if i + j <= N and S[i + j] == '0':
			i += j
			flag = 1
			ans.append(j)
			break
	if flag:
		continue
	print(-1)
	return
ans.reverse()
print(*ans)


from collections import deque
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	inf = 10 ** 9
	(n, m) = MI()
	s = SI()
	dp = [inf] * (n + 1)
	dp[0] = 0
	pre = [-1] * (n + 1)
	q = deque()
	q.append((0, 0))
	for (i, c) in enumerate(s[1:]):
		if q[0][0] == i - m:
			q.popleft()
		if c == '0':
			dp[i + 1] = q[0][1] + 1
			pre[i + 1] = q[0][0]
		while q and q[-1][1] > dp[i + 1]:
			q.pop()
		q.append((i + 1, dp[i + 1]))
	if dp[-1] >= inf:
		print(-1)
	else:
		ans = []
		now = n
		while n:
			ans.append(n - pre[n])
			n = pre[n]
		print(*ans[::-1])
main()


(n, m) = list(map(int, input().split()))
s = input()
si = []
for ch in s:
	if ch == '0':
		si.append(0)
	else:
		si.append(1)
ptr = n
ret = []
while ptr > 0:
	for me in range(m, -1, -1):
		if me == 0:
			print(-1)
			return
		if ptr - me < 0:
			continue
		if si[ptr - me] == 0:
			ret.append(me)
			ptr -= me
			break
ret.reverse()
print(' '.join(map(str, ret)))


(n, m) = list(map(int, input().split()))
s = input()
one_sequence = 0
for i in range(1, n):
	if s[i] == '1':
		one_sequence += 1
		if one_sequence == m:
			print(-1)
			return
	else:
		one_sequence = 0
pos = n
ans = ''
while pos != 0:
	for i in range(1, m + 1)[::-1]:
		if pos - i < 0:
			continue
		if s[pos - i] != '1':
			ans = str(i) + ' ' + ans
			pos -= i
			break
print(ans)


(n, m) = map(int, input().split())
s = input()[::-1]
ans = []
flg = True
cur = 0
while cur < n and flg:
	for to in range(cur + m, cur, -1):
		if to > n:
			continue
		if s[to] == '0':
			ans.append(to - cur)
			cur = to
			break
		if to == cur + 1:
			flg = False
if flg:
	print(*ans[::-1])
else:
	print(-1)


(n, m) = list(map(int, input().split()))
masu = list(input())
idx = n
ans = []
while True:
	valid = False
	next_min_idx = max(idx - m, 0)
	for candi in reversed(list(range(next_min_idx, idx))):
		if masu[candi] == '0':
			destination = candi
			valid = True
	if not valid:
		print(-1)
		return
	ans.append(idx - destination)
	idx = destination
	if idx == 0:
		break
str_list = list(map(str, ans))
print(' '.join(reversed(str_list)))


from sys import stdin

def main():
	readline = stdin.readline
	(n, m) = map(int, readline().split())
	s = readline().strip()
	ans = []
	flag = False
	i = n
	while True:
		max_i = i
		for sa in range(1, m + 1):
			if i - sa == 0:
				ans.append(sa)
				flag = True
				break
			elif s[i - sa] == '0':
				max_i = i - sa
		if flag:
			break
		elif max_i != i:
			ans.append(i - max_i)
			i = max_i
		else:
			break
	if flag:
		ans.reverse()
		print(*ans)
	else:
		print(-1)

def __starting_point():
	main()
__starting_point()


import sys

def input():
	return sys.stdin.readline().strip()

def main():
	(N, M) = map(int, input().split())
	S = input()

	def isOK(index):
		return S[index] == '0'
	ans = []
	now = N
	while now:
		for step in range(min(now, M), -1, -1):
			if step == 0:
				print(-1)
				return
			if isOK(now - step):
				ans.append(step)
				now -= step
				break
	print(*ans[::-1], sep=' ')

def __starting_point():
	main()
__starting_point()


(N, M) = map(int, input().split())
S = input()[::-1]
l = []
p = 0
chk = True
while p < N:
	for i in range(1, min(M, N - p) + 1)[::-1]:
		if S[p + i] == '0':
			break
	else:
		print(-1)
		chk = False
		break
	l.append(i)
	p += i
if chk:
	l.reverse()
	print(*l)


(n, m) = map(int, input().split())
s = input()
s = s[::-1]
INF = 2 * n
if '1' * m in s:
	print(-1)
	return
dp = [-1] * (n + 1)
nw = 0
st = 0
nst = 0
ret = []
while nw < n + 1:
	if s[nw] == '1':
		dp[nw] = INF
	else:
		dp[nw] = dp[st] + 1
		nst = nw
	nw += 1
	if nw == n + 1:
		ret.append(nst - st)
	elif nw > st + m:
		ret.append(nst - st)
		st = nst
print(' '.join(map(str, ret[::-1])))


import bisect
(N, M) = list(map(int, input().split()))
S = input()
ok = True
cnt = 0
for c in S:
	if c == '1':
		cnt += 1
		if cnt == M:
			ok = False
			break
	else:
		cnt = 0
ngo_pos = [0 for _ in range(N + 1)]
most_neighbor_zero_pos = N
for i in range(N, -1, -1):
	if S[i] == '0':
		ngo_pos[i] = i
		most_neighbor_zero_pos = i
	else:
		ngo_pos[i] = most_neighbor_zero_pos
if not ok:
	print(-1)
else:
	ans = []
	pos = N
	while pos > 0:
		npos = ngo_pos[max(0, pos - M)]
		ans.append(pos - npos)
		pos = npos
	print(' '.join(map(str, ans[::-1])))


(n, m) = map(int, input().split())
s = input()
dp = [-1 for _i in range(n + 1)]
dp[0] = 0
f = 0
from collections import deque
q = deque([0])
c = 0
for i in range(1, n + 1):
	if s[i] == '0':
		c = 0
		while i - f > m:
			f = q.popleft()
		dp[i] = f
		q.append(i)
	elif c < m - 1:
		c += 1
	else:
		break
if dp[n] >= 0:
	r = []
	p = n
	while p > 0:
		nex = dp[p]
		r.append(p - nex)
		p = nex
	print(*r[::-1])
else:
	print(-1)


(n, m) = map(int, input().split())
s = input()
s = s[::-1]
ans = []
cur = 0
c = 0
while cur < n:
	d = n - cur
	r = min(m, d)
	cnt = 0
	for i in range(r):
		x = r - i
		if s[cur + x] == '0':
			ans.append(x)
			cur += x
			break
		else:
			cnt += 1
	if cnt == r:
		print(-1)
		return
print(*ans[::-1])


def main():
	import sys
	input = sys.stdin.readline
	sys.setrecursionlimit(10 ** 7)
	from collections import Counter, deque
	from itertools import combinations, permutations, accumulate, groupby, product
	from bisect import bisect_left, bisect_right
	from heapq import heapify, heappop, heappush
	import math
	(n, m) = map(int, input().split())
	s = input().rstrip()
	s = s[::-1]
	safe = []
	for i in range(n + 1):
		if s[i] == '0':
			safe.append(i)
	res = []
	pos = 0
	while pos < n:
		pre = pos
		pos += m
		if pos >= n:
			res.append(str(n - pre))
			break
		idx = bisect_left(safe, pos)
		if safe[idx] > pos:
			pos = safe[idx - 1]
		if pre == pos:
			print(-1)
			return
		res.append(str(pos - pre))
	print(*res[::-1])

def __starting_point():
	main()
__starting_point()


(N, M) = map(int, input().split())
S = list(input())
S.reverse()
if S[0] == 1 or S[-1] == 1:
	det = -1
else:
	det = 0
	count = 0
	data = []
	for i in range(N + 1):
		if S[i] == '0':
			data.append(count + 1)
			count = 0
		else:
			count += 1
		if count == M:
			det = -1
			break
if det != -1:
	ans = []
	count = 0
	for i in range(1, len(data)):
		if count + data[i] > M:
			ans.append(count)
			count = data[i]
		else:
			count += data[i]
	ans.append(count)
	ans.reverse()
	print(' '.join(map(str, ans)))
else:
	print(-1)


(n, m) = map(int, input().split())
s = input()[::-1]
ans = []
pos = 0
while pos != n:
	for i in range(min(n - pos, m), 0, -1):
		if s[pos + i] == '0':
			ans.append(i)
			pos += i
			break
	else:
		print(-1)
		return
print(*ans[::-1])


(n, m) = map(int, input().split())
(*s,) = map(int, input()[::-1])
i = 0
a = []
while i < n:
	j = min(n, i + m)
	while s[j]:
		j -= 1
	if j == i:
		print(-1)
		return
	a += (j - i,)
	i = j
print(*a[::-1])


import sys

def solve():
	input = sys.stdin.readline
	(N, M) = map(int, input().split())
	S = input().strip('\n')
	now = N
	ans = []
	while now > 0:
		for i in reversed(range(1, M + 1)):
			if now - i < 0:
				continue
			elif S[now - i] == '0':
				ans.append(i)
				now -= i
				break
		else:
			print(-1)
			break
	else:
		A = [int(ans[-1 - i]) for i in range(len(ans))]
		print(' '.join(map(str, A)))
	return 0

def __starting_point():
	solve()
__starting_point()


(n, m) = list(map(int, input().split()))
s = list(input())
s.reverse()
ng = False
c = 0
ans = []
while ng == False and c < n:
	for i in range(m, 0, -1):
		if c + i < n + 1 and s[c + i] == '0':
			c += i
			ans.append(str(i))
			break
		elif i == 1:
			ng = True
if ng:
	print(-1)
else:
	ans.reverse()
	print(' '.join(ans))


import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 6)
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
nn = lambda : list(stdin.readline().split())
ns = lambda : stdin.readline().rstrip()
(n, m) = na()
s = list(ns())
s = s[::-1]
ans = []
i = 0
while True:
	j = i + m if i + m < n else n
	for k in reversed(range(i + 1, j + 1)):
		if s[k] == '0':
			ans.append(k - i)
			i = k
			break
	else:
		print(-1)
		return
	if i == n:
		break
print(*ans[::-1], sep=' ')


(N, M) = map(int, input().split())
S = list(input())
T = S[::-1]
D = [0] * N
if N <= M:
	print(N)
	return
r = 0
(renzoku, ma) = (0, 0)
for i in range(1, N + 1):
	if S[i] == '1':
		renzoku += 1
	else:
		ma = max(ma, renzoku)
		renzoku = 0
if ma >= M:
	print(-1)
	return
for i in range(1, M + 1):
	if T[i] != '1':
		D[i] = 1
		r = i
	else:
		D[i] = 100000
ans = [r]
while r + M < N:
	for i in range(M, 0, -1):
		if T[r + i] == '0':
			ans.append(i)
			r += i
			break
ans.append(N - r)
print(*ans[::-1])


(n, m) = map(int, input().split())
S = list(input())
S_r = S[::-1] + ['0']
ans = []
now = 0
while now < n:
	flg = True
	for i in range(m, 0, -1):
		if now + i <= n and S_r[now + i] == '0':
			ans.append(i)
			now += i
			flg = False
			break
	if flg:
		print(-1)
		return
print(*ans[::-1])


import sys

def input():
	return sys.stdin.readline().rstrip()

class SegmentTree:
	__slots__ = ['func', 'e', 'original_size', 'n', 'data']

	def __init__(self, length_or_list, func=max, e=-10 ** 18):
		self.func = func
		self.e = e
		if isinstance(length_or_list, int):
			self.original_size = length_or_list
			self.n = 1 << (length_or_list - 1).bit_length()
			self.data = [self.e] * (self.n * 2)
		else:
			self.original_size = len(length_or_list)
			self.n = 1 << (self.original_size - 1).bit_length()
			self.data = [self.e] * self.n + length_or_list + [self.e] * (self.n - self.original_size)
			for i in range(self.n - 1, 0, -1):
				self.data[i] = self.func(self.data[2 * i], self.data[2 * i + 1])

	def replace(self, index, value):
		index += self.n
		self.data[index] = value
		index //= 2
		while index > 0:
			self.data[index] = self.func(self.data[2 * index], self.data[2 * index + 1])
			index //= 2

	def folded(self, l, r):
		left_folded = self.e
		right_folded = self.e
		l += self.n
		r += self.n
		while l < r:
			if l % 2:
				left_folded = self.func(left_folded, self.data[l])
				l += 1
			if r % 2:
				r -= 1
				right_folded = self.func(self.data[r], right_folded)
			l //= 2
			r //= 2
		return self.func(left_folded, right_folded)

	def all_folded(self):
		return self.data[1]

	def __getitem__(self, index):
		return self.data[self.n + index]

	def max_right(self, l, f):
		if l >= self.original_size:
			return self.original_size
		l += self.n
		left_folded = self.e
		while True:
			while l % 2 == 0:
				l //= 2
			if not f(self.func(left_folded, self.data[l])):
				while l < self.n:
					l *= 2
					if f(self.func(left_folded, self.data[l])):
						left_folded = self.func(left_folded, self.data[l])
						l += 1
				return l - self.n
			left_folded = self.func(left_folded, self.data[l])
			l += 1
			if l == l & -l:
				break
		return self.original_size

	def min_left(self, r, f):
		if r == 0:
			return 0
		r += self.n
		right_folded = self.e
		while True:
			r //= r & -r
			if not f(self.func(self.data[r], right_folded)):
				while r < self.n:
					r = 2 * r + 1
					if f(self.func(self.data[r], right_folded)):
						right_folded = self.func(self.data[r], right_folded)
						r -= 1
				return r + 1 - self.n
			if r == r & -r:
				break
		return 0

def minindex(x, y):
	if x[0] <= y[0]:
		return x
	else:
		return y

def main():
	(n, m) = map(int, input().split())
	S = list(map(lambda x: 0 if x == '0' else 10 ** 10, list(input())))
	roots = [10 ** 10] * (n + 1)
	for i in range(1, min(m + 2, n + 1)):
		if S[i] < 10 ** 9:
			S[i] = 1
			roots[i] = 0
	S = [[s, i] for (i, s) in enumerate(S)]
	seg = SegmentTree(S, minindex, [10 ** 12, 10 ** 12])
	for i in range(m + 1, n + 1):
		if S[i][0] < 10 ** 9:
			(dist, masu) = seg.folded(i - m, i)
			roots[i] = masu
			seg.replace(i, [dist + 1, i])
	if seg.folded(n, n + 1)[0] > 10 ** 9:
		print(-1)
	else:
		ans = []
		while n > 0:
			ans.append(n - roots[n])
			n = roots[n]
		print(*ans[::-1], sep=' ')

def __starting_point():
	main()
__starting_point()


import sys
(N, M) = map(int, input().split())
S = input()
tmp = 0
for i in range(N + 1):
	if S[i] == '1':
		tmp += 1
		if tmp == M:
			print(-1)
			return
	else:
		tmp = 0
ans = []
i = N
while i > M:
	ind = S[i - M:i].find('0')
	ans.append(M - ind)
	i -= M - ind
ans.append(i)
print(*ans[::-1])


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
in_n = lambda : int(readline())
in_nn = lambda : list(map(int, readline().split()))
in_s = lambda : readline().rstrip().decode('utf-8')
in_nl = lambda : list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda : [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda : list(map(int, read().split()))

def main():
	(N, M) = in_nn()
	S = in_s()
	ans = []
	now = N
	while now > 0:
		next = -1
		end = max(0, now - M)
		for i in range(now - 1, end - 1, -1):
			if S[i] == '0':
				next = i
		if next == -1:
			print(-1)
			return
		else:
			ans.append(now - next)
			now = next
	ans = ans[::-1]
	print(' '.join(map(str, ans)))

def __starting_point():
	main()
__starting_point()


(N, M) = map(int, input().split())
S = input()[::-1]
if M >= N:
	print(N)
	return
p = -1
for i in reversed(range(1, M + 1)):
	if S[i] == '0':
		p = i
		break
if p == -1:
	print(-1)
	return
ps = [p]
while 1:
	tmp = -1
	for i in reversed(range(ps[-1] + 1, ps[-1] + M + 1)):
		try:
			if S[i] == '0' or i == N:
				ps.append(i)
				tmp = i
				break
		except:
			pass
	if tmp == -1:
		print(-1)
		return
	if ps[-1] == N:
		break
pp = [ps[i + 1] - ps[i] for i in range(len(ps) - 1)][::-1] + [ps[0]]
print(*pp)


(n, m) = map(int, input().split())
s = input()
out_s = '1' * m
if out_s in s:
	print(-1)
	return
s = s[::-1]
if s[0] == '1':
	print(-1)
	return
pre = [-1] * (n + 1)
stack = [0]
while stack:
	now = stack.pop()
	if now == n:
		break
	for i in range(1, m + 1):
		tsugi = now + i
		if tsugi > n:
			continue
		if s[tsugi] == '1':
			continue
		pre[tsugi] = now
		stack.append(tsugi)
else:
	print(-1)
	return
ato = n
mae = pre[n]
ans = []
while mae >= 0:
	ans.append(ato - mae)
	ato = mae
	mae = pre[ato]
print(*ans, sep=' ')


(n, m) = map(int, input().split())
s = input()[::-1]
count = 1
inf = 10 ** 10
length = [inf] * (n + 1)
length[0] = 0
now = 0
flag = True
while flag:
	ok = 0
	for i in range(1, m + 1):
		if s[now + i] == '1':
			continue
		length[now + i] = count
		ok = now + i
		if now + i == n:
			flag = False
			break
	if ok == 0:
		print(-1)
		return
	now = ok
	count += 1
count -= 2
li = []
length = length[::-1]
point = 0
for (i, j) in enumerate(length):
	if j == count:
		count -= 1
		li.append(point)
		point = 0
	point += 1
print(*li)


(N, M) = map(int, input().split())
S = input()
ans = []
i = N
while i > 0:
	if i <= M:
		ans.append(i)
		break
	for j in range(M, 0, -1):
		if S[i - j] == '1':
			continue
		ans.append(j)
		i -= j
		break
	else:
		print(-1)
		return
print(*ans[::-1])


(n, m) = list(map(int, input().split()))
s = list(input())[::-1]
i = 0
ans = 0
ans_list = []
while i < n:
	l = s[i + 1:i + m + 1]
	for next in range(m - 1, -2, -1):
		if next == -1:
			print(-1)
			return
		if next > len(l) - 1:
			continue
		if l[next] == '0':
			ans_list.append(next + 1)
			i += next + 1
			break
print(' '.join(map(str, ans_list[::-1])))


import sys
sys.setrecursionlimit(10 ** 6)
buff_readline = sys.stdin.readline
readline = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(buff_readline())

def read_int_n():
	return list(map(int, buff_readline().split()))

def read_float():
	return float(buff_readline())

def read_float_n():
	return list(map(float, buff_readline().split()))

def read_str():
	return readline().strip()

def read_str_n():
	return readline().strip().split()

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

class Mod:

	def __init__(self, m):
		self.m = m

	def add(self, a, b):
		return (a + b) % self.m

	def sub(self, a, b):
		return (a - b) % self.m

	def mul(self, a, b):
		return a % self.m * (b % self.m) % self.m

	def div(self, a, b):
		return self.mul(a, pow(b, self.m - 2, self.m))

	def pow(self, a, b):
		return pow(a, b, self.m)

class Bisect:

	def __init__(self, func):
		self.__func = func

	def bisect_left(self, x, lo, hi):
		while lo < hi:
			mid = (lo + hi) // 2
			if self.__func(mid) < x:
				lo = mid + 1
			else:
				hi = mid
		return lo

	def bisect_right(self, x, lo, hi):
		while lo < hi:
			mid = (lo + hi) // 2
			if x < self.__func(mid):
				hi = mid
			else:
				lo = mid + 1
		return lo

@mt
def slv(N, M, S):
	from functools import lru_cache

	@lru_cache(maxsize=None)
	def dfs(x):
		if x == 0:
			return []
		for i in range(M, 0, -1):
			if 0 <= x - i and S[x - i] == '0':
				r = dfs(x - i)
				if r is not None:
					r.append(i)
					return r
		return None
	ans = dfs(N)
	if ans is None:
		ans = [-1]
	return ans

def main():
	(N, M) = read_int_n()
	S = read_str()
	print(*slv(N, M, S))

def __starting_point():
	main()
__starting_point()


(N, M) = list(map(int, input().split()))
S = input()
S = S[::-1]
l = len(S)
idx = 0
answer = []
flag = False
while True:
	if l - idx > M:
		m = M
	else:
		m = l - idx - 1
		flag = True
	if S[idx + m] == '0':
		answer.append(m)
		idx += m
		if flag:
			break
	else:
		while S[idx + m] == '1':
			m -= 1
			if m == 0:
				print(-1)
				return
		answer.append(m)
		idx += m
if answer[-1] == 0:
	answer.pop()
answer = answer[::-1]
print(' '.join(map(str, answer)))


(n, m) = map(int, input().split())
s = input()
s = ''.join(reversed(s))
ans = []
index = 0
while index < n:
	next_index = -1
	for j in range(min(index + m, n), index, -1):
		if s[j] == '0':
			next_index = j
			break
	if next_index == -1:
		ans = [-1]
		break
	ans.append(next_index - index)
	index = next_index
print(' '.join(list(map(str, list(reversed(ans))))))


(N, M) = list(map(int, input().split()))
S = input()
p = N
prev = N
flag = True
ans = []
for i in range(N, -1, -1):
	if prev - i > M:
		ans.append(prev - p)
		prev = p
		if prev - i > M:
			flag = False
			break
	if S[i] == '0':
		p = i
ans.append(prev)
if flag:
	print(' '.join(map(str, ans[::-1])))
else:
	print(-1)


def main():
	(N, M) = list(map(int, input().split()))
	S = [int(s) for s in input()][::-1]
	ANS = []
	t = 0
	while t < N:
		for i in range(min(M, N - t), 0, -1):
			if S[t + i] == 0:
				ANS.append(i)
				t += i
				break
		else:
			print(-1)
			return
	if sum(ANS) == N:
		print(' '.join(map(str, ANS[::-1])))
	else:
		print(-1)

def __starting_point():
	main()
__starting_point()


import sys
sys.setrecursionlimit(10 ** 6)
(n, m) = map(int, input().split())
s = input()
ans = []

def f(i, j):
	if i == 0:
		print(' '.join(map(str, ans[::-1])))
		return
	if j > i:
		j = i
	while s[i - j] == '1':
		j -= 1
	if j == 0:
		print(-1)
		return
	ans.append(j)
	f(i - j, m)
f(n, m)


(N, M) = map(int, input().split())
S = input()
now = S[N - 1]
dp = [float('INF')] * (N + 1)
dp[N] = 0
nowmin = 0
right = N
for left in range(N - 1, -1, -1):
	while right - left > M or S[right] == '1':
		right -= 1
		nowmin = dp[right]
	if right <= left:
		print(-1)
		return
	if S[left] == '1':
		continue
	else:
		dp[left] = 1 + nowmin
now = dp[0]
nowi = 0
for i in range(1, N + 1):
	if now > dp[i]:
		print(i - nowi, end=' ')
		now = dp[i]
		nowi = i


(N, M) = map(int, input().split())
S = input()
S = S[::-1]
now = 0
ok = 1
history = []
while True:
	for i in range(min(M, N - now), 0, -1):
		if S[now + i] == '0':
			now += i
			history.append(str(i))
			break
		if i == 1:
			print(-1)
			ok = 0
			break
	if ok == 0:
		break
	if now == N:
		break
if ok == 1:
	print(' '.join(history[::-1]))


def main():
	(n, m) = map(int, input().split())
	s = input().rstrip()
	ans = []
	x = n
	f = True
	while x > 0 and f:
		for i in reversed(range(m + 1)):
			if i == 0:
				f = False
				break
			if s[max(0, x - i)] == '0':
				if x - i < 0:
					ans.append(x)
				else:
					ans.append(i)
				x = max(0, x - i)
				break
	if f:
		for v in reversed(ans):
			print(v, end=' ')
		print('')
	else:
		print('-1')

def __starting_point():
	main()
__starting_point()


(n, m) = map(int, input().split())
s = input()
l = []
cur = n
while cur > 0:
	position = cur
	cur = max(0, cur - m)
	while s[cur] == '1':
		cur += 1
	if cur == position:
		print(-1)
		return
	l.append(str(position - cur))
l.reverse()
print(' '.join(l))


(n, m) = map(int, input().split())
s = input()
n += 1
pos = [n - 1]
ind = n - 1
while True:
	tmp = -1
	for i in range(1, m + 1):
		if s[max(ind - i, 0)] == '0':
			tmp = max(ind - i, 0)
	if tmp == -1:
		print(-1)
		return
	pos.append(tmp)
	ind = tmp
	if ind == 0:
		break
tmp = pos[::-1]
ans = []
for i in range(len(tmp) - 1):
	ans.append(tmp[i + 1] - tmp[i])
print(*ans)


safe = []
(n, m) = map(int, input().split())
field = list(input())
for i in range(n + 1):
	if field[i] == '0':
		safe.append(i)
start = n
import bisect
deque = []
flag = True
while start > 0:
	if start >= m:
		index = bisect.bisect_left(safe, start - m)
		if safe[index] != start:
			deque.append(start - safe[index])
			start = safe[index]
		elif safe[index] == start:
			flag = False
			start = 0
	else:
		deque.append(start)
		start = 0
if flag:
	deque = deque[::-1]
	print(*deque)
else:
	print(-1)


(n, m) = map(int, input().split())
sugoroku = input()[::-1]
cnt = 0
pos = 0
tmp = 0
lst = []
while pos != n:
	pos += 1
	cnt += 1
	if cnt == m:
		if sugoroku[pos] == '0':
			lst.append(cnt)
			cnt = 0
		else:
			if tmp == 0:
				print(-1)
				return
			lst.append(tmp)
			cnt -= tmp
			tmp = 0
	elif sugoroku[pos] == '0':
		tmp = cnt
if cnt != 0:
	lst.append(cnt)
for num in lst[::-1]:
	print(num, end=' ')


(N, M) = map(int, input().split())
S = input()
p = N
ans = []
ans_ok = True
while True:
	if p <= M:
		ans.append(p)
		p -= p
		break
	check = False
	for i in range(M, 0, -1):
		if S[p - i] == '0':
			check = True
			ans.append(i)
			p -= i
			break
	if not check:
		ans_ok = False
		break
if ans_ok:
	print(' '.join(map(str, ans[::-1])))
else:
	print(-1)


(n, m) = map(int, input().split())
s = input()
roulette = []
cur = n
while cur > m:
	for a in range(m):
		if s[cur - m + a] == '0':
			roulette.append(m - a)
			cur = cur - m + a
			break
	else:
		print(-1)
		break
else:
	roulette.append(cur)
	print(' '.join(map(str, roulette[::-1])))


(N, M) = map(int, input().split())
S = input()
pos = N
ans = []
while pos > 0:
	for i in range(M, 0, -1):
		if pos - i < 0 or S[pos - i] == '1':
			continue
		ans.append(i)
		pos -= i
		break
	else:
		ans = [-1]
		break
print(*ans[::-1])


(n, m) = list(map(int, input().split()))
s = list(map(int, list(input())))
ans = []
i = n
while i > 0:
	j = max(0, m - i)
	while s[i - (m - j)] != 0:
		j += 1
		if j == m:
			print(-1)
			return
	ans.append(m - j)
	i -= m - j
ans.reverse()
print(' '.join(map(str, ans)))


from bisect import bisect_right
(N, M) = map(int, input().split())
S = [-i for (i, s) in enumerate(input()) if s == '0']
S = S[::-1]
ans = []
now = 0
while S[now] != 0:
	to = bisect_right(S, S[now] + M) - 1
	if to == now:
		print('-1')
		return
	ans.append(S[to] - S[now])
	now = to
ans = ans[::-1]
print(*ans)


(N, M) = map(int, input().split())
S = list(input())
(cnt, cnt1) = (0, 0)
for s in S:
	if s == '1':
		cnt1 += 1
	else:
		cnt = max(cnt, cnt1)
		cnt1 = 0
if cnt >= M:
	print(-1)
	return
ans = []
pos = N
while pos > 0:
	for m in range(M, 0, -1):
		if pos - m < 0:
			continue
		if S[pos - m] == '1':
			continue
		ans.append(m)
		pos -= m
		break
print(*ans[::-1])


import sys
from collections import deque

def solve():
	input = sys.stdin.readline
	(N, M) = map(int, input().split())
	S = input().strip('\n')
	ans = deque()
	current = N
	while current > 0:
		for i in reversed(range(1, M + 1)):
			if current - i >= 0 and S[current - i] == '0':
				ans.appendleft(i)
				current -= i
				break
		else:
			break
	if current > 0:
		print(-1)
	else:
		print(*ans, sep=' ')
	return 0

def __starting_point():
	solve()
__starting_point()


import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values():
	return list(map(int, input().split()))

def read_index():
	return [int(x) - 1 for x in input().split()]

def read_list():
	return list(read_values())

def read_lists(N):
	return [read_list() for n in range(N)]

def init_dp1(init, N):
	return [init for _ in range(N)]

def init_dp2(init, N, M):
	return [[init for _ in range(M)] for _ in range(N)]

class V:

	def __init__(self, f, v=None):
		self.f = f
		self.v = v

	def __str__(self):
		return str(self.v)

	def ud(self, n):
		if n is None:
			return
		if self.v is None:
			self.v = n
			return
		self.v = self.f(self.v, n)

def main():
	(N, M) = read_values()
	S = input().strip()[::-1]
	P = []
	t = 0
	tmp = 1
	for s in S[1:]:
		if s == '0':
			t = tmp
		tmp += 1
		if tmp > M:
			if t == 0:
				print(-1)
				return
			P.append(str(t))
			tmp -= t
			t = 0
	if t != 0:
		P.append(str(t))
	print(' '.join(P[::-1]))

def __starting_point():
	main()
__starting_point()


(N, M) = list(map(int, input().split()))
S = input()
lst = []
i = N
while i > 0:
	for j in range(min(i, M), 0, -1):
		if S[i - j] == '0':
			lst.append(j)
			i -= j
			break
	else:
		print(-1)
		return
print(' '.join(map(str, reversed(lst))))


(n, m) = map(int, input().split())
(s, l) = (input(), [])
while n > 0:
	for i in range(m, 0, -1):
		if i <= n and s[n - i] == '0':
			l.append(i)
			n -= i
			break
	else:
		print(-1)
		return ()
print(*l[::-1])


(N, M) = list(map(int, input().split()))
S = 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)
	return
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()
ans = []
i = N
while i > 0:
	prev = i
	for j in range(max(0, i - M), i):
		if S[j] == '0':
			ans.append(str(i - j))
			i = j
			break
	if i == prev:
		ans = -1
		break
if ans == -1:
	print(ans)
else:
	ans.reverse()
	print(*ans)


import sys
input = sys.stdin.readline

def main():
	(N, M) = map(int, input().split())
	S = input()
	ans = []
	check = [False] * (N + 1)
	idx = N
	while 0 < idx:
		f = False
		for i in range(M, 0, -1):
			if idx - i < 0:
				continue
			if S[idx - i] == '1':
				if check[idx - i]:
					print(-1)
					return
				else:
					check[idx - i] = True
			else:
				ans.append(i)
				idx -= i
				f = True
				break
		if not f:
			print(-1)
			return
	for a in ans[::-1]:
		print(a)

def __starting_point():
	main()
__starting_point()


import heapq

def main():
	(N, M) = list(map(int, input().split(' ')))
	S = input()
	T = S[::-1]
	dp = [-1] * (N + 1)
	que = [0] * M
	for (i, t) in enumerate(T):
		if i == 0:
			dp[0] = 0
			continue
		if len(que) == 0:
			print(-1)
			return
		index = heapq.heappop(que)
		if t == '1':
			continue
		dp[i] = 1 + dp[index]
		while len(que) < M:
			heapq.heappush(que, i)
	dp.reverse()
	path = list()
	target = dp[0] - 1
	cnt = 0
	for i in range(N + 1):
		if dp[i] != target:
			cnt += 1
		else:
			path.append(cnt)
			cnt = 1
			target -= 1
	print(' '.join(map(str, path)))

def __starting_point():
	main()
__starting_point()


from bisect import *
(n, m) = list(map(int, input().split()))
s = input()
masu = []
for i in range(n + 1):
	if s[i] == '0':
		masu.append(i)
now = n
ans = [n]
while now > 0:
	next = masu[bisect_left(masu, now - m)]
	if now != next:
		ans.append(next)
		now = next
	else:
		ans = -1
		break
if ans == -1:
	print(-1)
else:
	ans.reverse()
	for i in range(len(ans) - 1):
		print(ans[i + 1] - ans[i])


(n, m) = map(int, input().split())
a = list(map(int, list(input())))
dp = [-1] * (n + 1)
te = [-1] * (n + 1)
te[n] = 0
g = [n]
c = 0
r = n
for i in reversed(range(n)):
	if a[i]:
		continue
	if i + m < r:
		r = i + m
		while a[r]:
			r -= 1
		if r == i:
			print(-1)
			return
	dp[i] = r
	te[i] = te[r] + 1
	if c < te[i]:
		c += 1
		g.append(i)
	g[te[i]] = i
g = g[::-1]
d = [y - x for (x, y) in zip(g, g[1:])]
print(*d)


import sys
import math
import fractions
import bisect
import queue
import heapq
from collections import deque
sys.setrecursionlimit(4100000)
MOD = int(1000000000.0 + 7)
PI = 3.141592653589793
INF = 1e+18
(N, M) = list(map(int, input().split()))
S = input()
now = N
ans = []
while now > 0:
	for step in range(M, 0, -1):
		if now - step < 0:
			step = now
		if S[now - step] == '0':
			ans.append(step)
			now -= step
			break
		if step == 1:
			print(-1)
			return
ans.reverse()
ret = ''
for a in ans:
	ret += str(a) + ' '
print(ret)


import sys
import heapq

def main():
	input = sys.stdin.readline
	(n, m) = map(int, input().split())
	s = input()
	inf = pow(10, 6)
	ans = [inf] * (n + 1)
	key = []
	heapq.heapify(key)
	heapq.heappush(key, (0, n))
	ans[n] = 0
	index = n - 1
	count = 0
	while key:
		sub = heapq.heappop(key)
		(s1, s2) = (sub[0], sub[1])
		if s1 < count:
			continue
		count = s1 + 1
		subindex = index
		for i in range(min([index, s2 - 1]), max([-1, s2 - m - 1]), -1):
			if ans[i] != inf:
				continue
			if s[i] == '1':
				continue
			heapq.heappush(key, (count, i))
			ans[i] = s2
			subindex = i
		index = subindex
	if ans[0] == inf:
		print(-1)
	else:
		index = 0
		answer = []
		while True:
			subindex = ans[index]
			answer.append(subindex - index)
			if subindex == n:
				break
			index = subindex
		print(*answer)

def __starting_point():
	main()
__starting_point()


(n, m) = map(int, input().split())
s = list(str(input()))
s = list(reversed(s))
ds = []
d = 1
for i in range(1, n + 1):
	if s[i] == '0':
		ds.append(d)
		d = 1
	else:
		d += 1
temp0 = 0
ans = []
for i in range(len(ds)):
	if ds[i] > m:
		print(-1)
		return
	temp1 = temp0 + ds[i]
	if temp1 > m:
		ans.append(temp0)
		temp0 = ds[i]
	elif temp1 == m:
		ans.append(temp1)
		temp0 = 0
	else:
		temp0 = temp1
else:
	if temp0 != 0:
		ans.append(temp0)
ans = list(reversed(ans))
print(*ans)


(N, M) = list(map(int, input().split()))
S = input()
S = S[::-1]
count = 0
count_1 = 0
count_2 = 0
answer = []
ans = 0
for (i, s) in enumerate(S):
	if i == 0:
		pass
	elif i == N:
		count_1 += 1
		answer.append(count_1)
	elif s == '0' and count_1 < M - 1:
		count_1 += 1
		count = count_1
		count_2 = 0
	elif s == '0' and count_1 == M - 1:
		count_1 += 1
		count_2 = 0
		answer.append(count_1)
		count = 0
		count_1 = count
	elif count_1 < M - 1 and count_2 < M - 1:
		count_1 += 1
		count_2 += 1
	elif count_2 == M - 1:
		ans = -1
		break
	elif count_1 == M - 1:
		count_2 += 1
		answer.append(count)
		count_1 = count_2
		count = count_1
if ans == -1:
	print(-1)
else:
	print(' '.join(map(str, answer[::-1])))


(N, M) = map(int, input().split())
S = input()
ans = []
tmp = S[::-1]
index = 0
acnt = M
while True:
	if acnt == 0:
		print(-1)
		return
	if index + acnt <= N and tmp[index + acnt] == '0':
		ans.append(acnt)
		index += acnt
		acnt = M
	else:
		acnt -= 1
	if index == N:
		break
print(*reversed(ans))


(n, m) = map(int, input().split())
s = input()[::-1]
ans = []
now = 0
while now < n:
	t = 1
	for i in reversed(range(1, m + 1)):
		if now + i > n or s[now + i] == '1':
			continue
		now = now + i
		ans.append(i)
		t = 0
		break
	if t:
		print(-1)
		return
ans.reverse()
print(*ans, sep=' ')