class BIT: def __init__(self, n): self.n = n self.bit = [0]*(self.n+1) # 1-indexed def init(self, init_val): for i, v in enumerate(init_val): self.add(i, v) def add(self, i, x): # i: 0-indexed i += 1 # to 1-indexed while i <= self.n: self.bit[i] += x i += (i & -i) def sum(self, i, j): # return sum of [i, j) # i, j: 0-indexed return self._sum(j) - self._sum(i) def _sum(self, i): # return sum of [0, i) # i: 0-indexed res = 0 while i > 0: res += self.bit[i] i -= i & (-i) return res def lower_bound(self, x): s = 0 pos = 0 depth = self.n.bit_length() v = 1 << depth for i in range(depth, -1, -1): k = pos + v if k <= self.n and s + self.bit[k] < x: s += self.bit[k] pos += v v >>= 1 return pos def __str__(self): # for debug arr = [self.sum(i,i+1) for i in range(self.n)] return str(arr) n, k = map(int, input().split()) s = str(input()) s = 'o'+s def mex(bit): ok = -1 ng = k+2 while ok+1 < ng: c = (ng+ok)//2 if bit.sum(0, c+1) < c+1: ng = c else: ok = c #print(ok, ng) return ng from collections import deque, defaultdict bit = BIT(k+2) grundy = [-1]*n if s[n-1] == 'x': grundy[n-1] = k+1 else: grundy[n-1] = 0 q = deque([]) d = defaultdict(lambda:0) for i in range(k): a = grundy[n-1-i] t = bit.sum(a, a+1) bit.add(a, -t) bit.add(a, 1) q.append(a) d[a] += 1 if s[n-1-i-1] !='x': grundy[n-1-i-1] = mex(bit) else: grundy[n-1-i-1] = k+1 #print(grundy) for i in reversed(range(n-k-1)): b = q.popleft() d[b] -= 1 if d[b] == 0: bit.add(b, -1) a = grundy[i+1] if d[a] == 0: bit.add(a, 1) d[a] += 1 q.append(a) if s[i] != 'x': grundy[i] = mex(bit) else: grundy[i] = k+1 #print(grundy) if grundy[0] == 0: print(0) exit() ans = [] for i in range(1, k+1): if grundy[i] == 0: ans.append(i) print(*ans, sep='\n')