Problem:
 Score : 500 points    Problem Statement Takahashi has decided to work on K days of his choice from the N days starting with tomorrow.  You are given an integer C and a string S . Takahashi will choose his workdays as follows:   After working for a day, he will refrain from working on the subsequent C days.  If the i -th character of S is x , he will not work on Day i , where Day 1 is tomorrow, Day 2 is the day after tomorrow, and so on.   Find all days on which Takahashi is bound to work.      Constraints  1 \leq N \leq 2 \times 10^5  1 \leq K \leq N  0 \leq C \leq N  The length of S is N .  Each character of S is o or x .  Takahashi can choose his workdays so that the conditions in Problem Statement are satisfied.         Input Input is given from Standard Input in the following format:  N  K  C  S       Output Print all days on which Takahashi is bound to work in ascending order, one per line.        Sample Input 1 11 3 2
ooxxxoxxxoo      Sample Output 1 6  Takahashi is going to work on 3 days out of the 11 days. After working for a day, he will refrain from working on the subsequent 2 days.  There are four possible choices for his workdays: Day 1,6,10 , Day 1,6,11 , Day 2,6,10 , and Day 2,6,11 .  Thus, he is bound to work on Day 6 .       Sample Input 2 5 2 3
ooxoo      Sample Output 2 1
5  There is only one possible choice for his workdays: Day 1,5 .       Sample Input 3 5 1 0
ooooo      Sample Output 3  There may be no days on which he is bound to work.       Sample Input 4 16 4 3
ooxxoxoxxxoxoxxo      Sample Output 4 11
16

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K, C = mapint()
S = list(input())
r_S = S[::-1]

pos = [10**18]*N
neg = [10**18]*N
ok = 0
cnt = 0
for i in range(N):
    if S[i]=='o':
        if ok<=i:
            pos[i] = cnt + 1
            cnt += 1
            ok = i + C + 1

    else:
        pass
ok = 0
cnt = 0
for i in range(N):
    if r_S[i]=='o':
        if ok<=i:
            neg[i] = cnt + 1
            cnt += 1
            ok = i + C + 1

    else:
        pass

ans = []
neg = neg[::-1]

for i in range(N):
    if pos[i]+neg[i]-1==K:
        ans.append(i)
for a in ans:
    print(a+1)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K, C = mapint()
S = list(input())
r_S = S[::-1]

pos = [0]*N
neg = [0]*N
ok = 0
cnt = 0
for i in range(N):
    if S[i]=='o':
        if ok<=i:
            pos[i] = cnt + 1
            cnt += 1
            ok = i + C + 1
            if cnt==K:
                break

    else:
        pass
ok = 0
cnt = 0
for i in range(N):
    if r_S[i]=='o':
        if ok<=i:
            neg[i] = cnt + 1
            cnt += 1
            ok = i + C + 1
            if cnt==K:
                break

    else:
        pass

ans = []
neg = neg[::-1]

for i in range(N):
    if pos[i]+neg[i]-1==K:
        ans.append(i)
for a in ans:
    print(a+1)

Solution (Python):
def sep():
    return map(int,input().strip().split(" "))
def lis():
    return list(sep())
import sys
sys.setrecursionlimit(10**6)

n,k,c=sep()
s=input()
c1=[0]*(n+5)
c2=[0]*(n+5)
for i in range(n):
    if s[i]=="x":
        c1[i]=c1[i-1]
    else:
        c1[i]=max(c1[i-1],c1[i-c-1]+1)
for i in range(n-1,-1,-1):
    if s[i]=="x":
        c2[i]=c2[i+1]
    else:
        c2[i]=max(c2[i+1],c2[(i+c+1)%n]+1)
ans=[]
if c2[1]==k-1 and s[0]=="o":
    ans.append(1)

for i in range(1,n-1):
    if s[i]=="x":
        continue
    if c1[i-1] + c2[i+1]==k-1:
        ans.append(i+1)

if n!=1:
    if c1[n-2]==k-1 and s[0]=="o":
        ans.append(n)

for i in ans:
    print(i)

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
from heapq import heapify, heappop, heappush
import math
import random
import string
from copy import deepcopy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7





"""
N日間のうちK日選んで働く
働いたらそれからC日間は働かない
Sにxがついていたら働かない

oの付いてる日のみ働く
全ての通りを求めてみよう

N, K, C = 11, 3, 2
S = ooxxxoxxxoo の時
働けるのは[1, 2, 6, 10, 11]日目
ここから3つ以上間が空く条件で3つ選ぶと条件を満たす
全ての通りでi日目に働く必要がある

A = [1, 2, 5, 7, 11, 13, 16]
M = 4
C = 3

for bit in range(1 << len(A)):
    cnt = []
    for i in range(len(A)):
        if bit & (1 << i):
            cnt.append(A[i])
    if len(cnt) == 4:
        for i in range(1, len(cnt)):
            if cnt[i] - cnt[i - 1] <= C:
                break
        else:
            print(cnt)


[1, 5, 11, 16]
[1, 7, 11, 16]
[2, 7, 11, 16]

A = [1, 2, 5, 10, 24]
M = 3
C = 2
[1, 5, 10]
[2, 5, 10]
[1, 5, 24]
[2, 5, 24]
[1, 10, 24]
[2, 10, 24]
[5, 10, 24]
[1, 5, 10, 24] M + 1回以上ジャンプできる場合には答えが[]になる
A[0]から頑張ってもM回しかジャンプできない

間がC + 1以上離れたM個の集合はどのように求める？
必ず働く日の特性は？
動かすと？
場所は固定？
"""



N, K, C = getNM()
S = input()


place = []
for i in range(N):
    if S[i] == 'o':
        place.append(i)


fore = [place[0]]
for i in place[1:]:
    if i - fore[-1] > C:
        fore.append(i)


back = deque([])
back.append(place[-1])
for i in place[::-1]:
    if back[0] - i > C:
        back.appendleft(i)
back = list(back)

if len(fore) != K:
    print()
    exit()

ans = []
for a, b in zip(fore, back):
    if a == b:
        ans.append(a + 1)

for i in ans:
    print(i)


"""
fore = [0] * N
if S[0] == 'o':
    fore[0] = 1

for i in range(1, N):
    fore[i] = fore[i - 1]
    if S[i] == 'o' and i - C - 1 >= 0:
        fore[i] = max(fore[i], fore[i - C - 1] + 1)

back = [float('inf')] * N
ma = max(fore)
if S[N - 1] == 'o':
    back[N - 1] = ma

for i in range(N - 2, -1, -1):
    back[i] = min(ma, back[i + 1])
    if S[i] == 'o' and i + C + 1 < N:
        back[i] = min(back[i], back[i + C + 1] - 1)
print(back)
"""

Solution (Python):
N, K, C = map(int, input().split())
S = input()
length = len(S)

INF = float('inf')
Ls = [-INF]
n = 0
for i, c in enumerate(S):
    if c == 'o' and i - Ls[-1] > C:
        Ls.append(i)
        n += 1
        if n >= K: break

Rs = [INF]
n = 0
for i, c in enumerate(reversed(S)):
    if c == 'o' and Rs[-1] - (length-1-i) > C:
        Rs.append(length-1-i)
        n += 1
        if n >= K: break
Rs.reverse()

for l, r in zip(Ls[1:], Rs[:-1]):
    if l == r:
        print(l+1)

Solution (Python):
n,k,c = map(int,input().split())
s = input()
canwork=[0]*(n+1) 
canwork2 = [0]*(c+n+3)
for i in range(n):
    if s[i] == "o":
        canwork[i+1]=max(canwork[i],canwork[i-c]+1)
        
    else:
        canwork[i+1] = canwork[i]
        
for i in range(n)[::-1]:
    if s[i] == "o":
        canwork2[i]=max(canwork2[i+1],canwork2[i+c+1]+1)
    else:
        canwork2[i] = canwork2[i+1]

ans = []
for i in range(n):
    if canwork[i]+canwork2[i+1]==k-1:
        ans.append(i+1)
print(*ans)

Solution (Python):
n,k,c = map(int, input().split())
s = input()
sr = s[::-1]
lcnt = [0]*n
rcnt = [0]*n

last_i = -10**8
cnt = 0
for i in range(n):
    if s[i] == 'o' and i - last_i > c:
        cnt += 1
        last_i = i
    lcnt[i] = cnt


last_i = -10**8
cnt = 0
for i in range(n):
    if sr[i] == 'o' and i - last_i > c:
        cnt += 1
        last_i = i
    rcnt[i] = cnt
rcnt = rcnt[::-1]


for i in range(n):
    if s[i] == 'x': continue
    if i > 0: l = lcnt[i-1]
    else: l = 0
    if i < n-1: r = rcnt[i+1]
    else: r = 0
    if l+r < k:
        print(i+1)

Solution (Python):
n,k,c = map(int,input().split())
s = input()
l = [0]*k
r = [0]*k

start = 0
count = 0
while count <= k-1 and start <= n-1:
    if s[start] == "o":
        l[count] = start
        count += 1
        start += 1+c
    else:
        start += 1


start = n-1
count = k-1
while count >= 0 and start >= 0:
    if s[start] == "o":
        r[count] = start
        count -= 1
        start -= 1+c
    else:
        start -= 1


for i in range(k):
    if l[i] == r[i]:
        print(l[i] + 1)

Solution (Python):
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n,k,c=map(int,input().split())
s=input()

l_lst=[0]*k
r_lst=[0]*k

l=-float('inf')
cnt=0
for i in range(n):
    if i-l>c and s[i]!="x":
        l_lst[cnt]=i
        cnt+=1
        l=i
        if cnt==k:
            break

l=float('inf')
cnt=0
for i in range(n)[::-1]:
    if l-i>c and s[i]!="x":
        r_lst[-1-cnt]=i
        cnt+=1
        l=i
        if cnt==k:
            break


for i,j in zip(l_lst,r_lst):
    if i==j:
        print(i+1)

Solution (Python):
N,K,C=map(int,input().split())
S=input()

mae=[]
rest=0
work=0
for i in range(len(S)):
    if S[i]=='o' and rest==0:
        mae.append(i)
        rest=C
        work+=1
    else:
        rest=max(rest-1,0)
    if work==K:
        break
        
usiro=[]
rest=0
work=0
S=S[::-1]
for i in range(len(S)):
    if S[i]=='o' and rest==0:
        usiro.append(len(S)-i-1)
        rest=C
        work+=1
    else:
        rest=max(rest-1,0)
    if work==K:
        break

usiro=usiro[::-1]

for i in range(K):
    if mae[i]==usiro[i]:
        print(mae[i]+1)

Solution (Python):

N, K, C = map(int, input().split())
C += 1
S = input()

DP = [-1 for _ in range(N)] 

day_prv = [-1] 
for day in range(N-1, -1, -1):
  if S[day] == "x": 
    day_prv.append(day_prv[-1])
  else:
    if day + C >= N or day_prv[-C] == -1:
      DP[day] = 1
    else:
      DP[day] = DP[day_prv[-C]] + 1
    day_prv.append(day) 
  
  
if DP[0] == K:
  val = DP[0]
  day_start = 0
  ct = 0
  while day_start < N:
    day = day_start
    while day < N and DP[day] != val-1:
      if DP[day] == val:
        ct += 1
      day += 1 
      
    if ct == 1:
      print(day_start+1)
    day_start = max(day, day_start + C)
    while day_start < N and DP[day_start] == -1:
      day_start += 1  
    
    ct = 0
    val -= 1

Solution (Python):
INF=float('inf')
n,k,c=map(int,input().split())
s=input()

L=[-1 for _ in range(n)]
cl=c+1
wl=1
for i in range(n):
  if wl>k:
    continue
  if s[i]=='x':
    cl+=1
  else:
    if cl>c:
      L[i]=wl
      wl+=1
      cl=1
    else:
      cl+=1

R=[-1 for _ in range(n)]
cr=c+1
wr=k
for j in range(n-1,-1,-1):
  if wr<1:
    continue
  if s[j]=='x':
    cr+=1
  else:
    if cr>c:
      R[j]=wr
      wr-=1
      cr=1
    else:
      cr+=1

for i in range(n):
  if L[i]==-1:
    continue
  if R[i]==-1:
    continue
  if L[i]==R[i]:
    print(i+1)

Solution (Python):
n, k, c = map(int, input().split())
s = input()
l = [0 for i in range(k)]
r = [0 for i in range(k)]
i, j = 0, 0
while i < n and (not l[-1]):
    if s[i] == "o":
        l[j] = i + 1
        i += c + 1
        j += 1
    else:
        i += 1
i, j = 0, k - 1
while i < n and (not r[0]):
    if s[n - i - 1] == "o":
        r[j] = n - i
        i += c + 1
        j -= 1
    else:
        i += 1
for i in range(k):
    if l[i] == r[i]:
        print(l[i])

Solution (Python):
def main():
  N, K, C=map(int, input().split())
  S = input()[::-1]
  
  R=[0]*K
  n, k=0, 0
  while k < K:
    if S[n]=='o':
      R[k]=N-n
      k+=1
      n += C
    n+=1
  R=R[::-1]
  
  S=S[::-1]
  n, k=0, 0
  while k < K:
    if S[n]=='o':
      if n+1 == R[k]:
        print(n+1)
      k+=1
      n += C
    n+=1
  
  
if __name__=='__main__':
  main()

Solution (Python):
def main():
  N, K, C=map(int, input().split())
  S = input()

  R=[0]*K
  n, k=N-1, 0
  while k < K:
    if S[n]=='o':
      R[k]=n+1
      k+=1
      n -= C
    n-=1
  R=R[::-1]
  
  n, k=0, 0
  while k < K:
    if S[n]=='o':
      if n+1 == R[k]:
        print(n+1)
      k+=1
      n += C
    n+=1
  
  

  
if __name__=='__main__':
  main()

Solution (Python):
n, k, c = map(int, input().split())
s = input()
left = [-1 for _ in range(k)]
right = [-1 for _ in range(k)]

bef = -10 ** 10
cnt = 0
for i, ss in enumerate(s):
    if ss == "o" and i - bef > c:
        if cnt == k:
            exit()
        left[cnt] = i
        bef = i
        cnt += 1

cnt = 0
bef = -10 ** 10
for i, ss in enumerate(s[::-1]):
    if ss == "o" and i - bef > c:
        if cnt == k:
            exit()
        right[k - 1 - cnt] = n - 1 - i
        bef = i
        cnt += 1


for ll, rr in zip(left, right):
    if ll == rr:
        print(ll + 1)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N,K,C=mi()
    S=list(input())
    ok,ng = "o","x"

    OK = []
    for i in range(N):
        if S[i] == ok:
            OK.append(i+1) 
    
    greeds = [OK[0]]
    for i in range(1,len(OK)):
        x = OK[i]
        if x - greeds[-1] > C:
            greeds.append(x)
            if len(greeds) > K:
                break

    inv_greeds = [OK[-1]]
    inv_OK = OK[::-1]
    for i in range(1,len(OK)):
        x = inv_OK[i]
        if -x + inv_greeds[-1] > C:
            inv_greeds.append(x)
            if len(inv_greeds) > K:
                break
    
    if len(greeds) < K or len(inv_greeds) < K:
        exit()

    greeds = greeds[:K]
    inv_greeds = inv_greeds[:K][::-1]

    
    for i in range(len(greeds)):
        if greeds[i] == inv_greeds[i]:
            print(greeds[i])



    
if __name__ == "__main__":
    main()

Solution (Python):
import sys
input = sys.stdin.buffer.readline




def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
	n,k,c=MI()
	s=RD()

	A=[]
	now=0

	while now<n and len(A)<k:
		if s[now]=="o":
			A.append(now+1)
			now+=c+1
		else:
			now+=1
	

	B=[]
	now=0
	while now<n and len(B)<k:
		if s[n-1-now]=="o":
			B.append(n-now)
			now+=c+1
		else:
			now+=1


	ans=[]
	for i,j in zip(A,B[::-1]):
		if i==j:
			ans.append(i)

	print(*ans,sep="\n")










if __name__ == "__main__":
	main()

Solution (Python):
import sys
input = sys.stdin.buffer.readline




def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
	n,k,c=MI()
	s=RD()

	A=[]
	now=0

	while now<n and len(A)<k:
		if s[now]=="o":
			A.append(now+1)
			now+=c+1
		else:
			now+=1
	

	B=[]
	now=0
	while now<n and len(B)<k:
		if s[n-1-now]=="o":
			B.append(n-now)
			now+=c+1
		else:
			now+=1


	ans=[]
	for i,j in zip(A,B[::-1]):
		if i==j:
			ans.append(i)

	print(*ans,sep="\n")










if __name__ == "__main__":
	main()

Solution (Python):
N, K, C = map(int, input().split())
S = input().rstrip()
P = [0]*(N+1)
cl, l, cr, r = 0, 1, 0, 1
for i in range(N):
    if cl > C and S[i] != "x": cl = 0; l += 1
    cl += 1
    P[i+1] += l
    if cr > C and S[-1-i] != "x": cr = 0; r += 1
    cr += 1
    P[N-2-i] += r
for i in range(N):
    if P[i] < K and S[i] == "o":
        print(i+1)

Solution (Python):
n, k, c = map(int, input().split())
s = input()

workL = [0] * (n + 1)
workR = [0] * (n + 1)

cnt = 0
left = 0

while left < n:
    if s[left] == 'o':
        workL[left + 1] += 1
        cnt += 1
        left += c
    left += 1

cnt = 0
right = n - 1
while right >= 0:
    if s[right] == 'o':
        workR[right] += 1
        cnt += 1
        right -= c
    right -= 1

for i in range(n - 1):
    workL[i + 1] += workL[i]
for i in range(n - 1, 0, -1):
    workR[i - 1] += workR[i]


print("\n".join(
    map(str, [i + 1 for i in range(n) if workL[i] + workR[i + 1] < k])))

Solution (Python):
N, K, C = list(map(int, input().split()))
S = input()

work_day_min = []
work_day_max = []

for i in range(N):
    if S[i] == 'o':
        if i > 0 and len(work_day_min) > 0:
            if i - work_day_min[-1] <= C:
                continue
        work_day_min.append(i)
    if len(work_day_min) == K:
        break

for i in range(N):
    if S[N - i - 1] == 'o':
        if i > 0 and len(work_day_max) > 0:
            if work_day_max[-1] - (N - i - 1) <= C:
                continue
        work_day_max.append(N - i - 1)
    if len(work_day_max) == K:
        break

for i in range(K):
    if work_day_min[i] == work_day_max[K-i-1]:
        print(work_day_min[i]+1)

Solution (Python):
N, K, C = map(int, input().split())
S = input()
A = []
cnt = 0
for i, s in enumerate(S, 1):
    if cnt > 0:
        cnt -= 1
    elif s == "o":
        cnt = C
        A.append(i)
if len(A) > K:
    exit()
B = []
cnt = 0
for i, s in zip(range(N, 0, -1), S[::-1]):
    if cnt > 0:
        cnt -= 1
    elif s == "o":
        cnt = C
        B.append(i)
assert len(B) == K
B.reverse()
Ans = []
for a, b in zip(A, B):
    if a == b:
        Ans.append(a)
print("\n".join(map(str, Ans)))

Solution (Python):

from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools, bisect
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def SL(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]

def perm(n, r): return math.factorial(n) // math.factorial(r)
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))

alphabets = "abcdefghijklmnopqrstuvwxyz"
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007
INF = float("inf")

def main():
    N, K, C = LI()
    S = SL()

    L = []
    rest = C
    for i, ch in enumerate(S):
        if ch == "o" and rest >= C:
            rest = -1
            L.append(i)
        rest += 1

    R = []
    rest = C
    for i, ch in list(enumerate(S))[::-1]:
        if ch == "o" and rest >= C:
            rest = -1
            R.append(i)
        rest += 1
        
    for a, b in zip(L[:K], R[:K][::-1]):
        if a == b:
            print(a + 1)


if __name__ == '__main__':
    main()

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



def main():
	
	n, k, c_yutori = tin()
	if n == 1:
		return 1
		
		
	s = input()
	can_work = [0]*n
	can_work[0] = 1 if s[0]=='o' else 0
	yn = c_yutori if s[0]=='o' else 0
	for i, c in enumerate( list(s)[1:],1):
		if yn == 0 and c == 'o':
			can_work[i] = can_work[i-1]+1
			yn = c_yutori
		else:
			can_work[i] = can_work[i-1]
			yn = max(0, yn - 1)
	need_to_work = [k]*n
	if s[-1]=='o':
		need_to_work[-1] = k-1
		yn = c_yutori
	else:
		need_to_work[-1]=k
		yn=0
	for i, c in enumerate(list(s)[-2::-1],1):
		pos = n-i-1
		if yn == 0 and c == 'o':
			need_to_work[pos] = need_to_work[pos+1]-1
			yn = c_yutori
		else:
			need_to_work[pos]=need_to_work[pos+1]
			yn = max(0, yn-1)
	
	
	if need_to_work[1] == 1:
		print(1)
		
	for i in range(1, n-1):
		if can_work[i-1] < need_to_work[i+1]:
			print(i+1)
		
	if can_work[-2]==k-1:
		print(n)
		
		
		
			
		
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
N, K, C = map(int, input().split())
S = input()

cand_l = []
cnt = 0
rest = 0
for i in range(N):
    if S[i] == "o" and rest <= 0 and cnt < K:
        cand_l.append(i + 1)
        rest = C
        cnt += 1
    else:
        rest -= 1

cand_r = []
cnt = 0
rest = 0
for i in reversed(range(N)):
    if S[i] == "o" and rest <= 0 and cnt < K:
        cand_r.append(i + 1)
        rest = C
        cnt += 1
    else:
        rest -= 1

for l, r in zip(cand_l, cand_r[::-1]):
    if l == r:
        print(l)

Solution (Python):
def solve():
  N, K, C = map(int, input().split())
  S = input()
  l_r,r_l = [0]*N,[0]*N
  i,cnt = 0,0
  while i<N and cnt<K:
    if S[i]=='o':
      l_r[i] = 1
      cnt += 1
      i += C
    i += 1
  j,cnt = N-1,0
  while j>=0 and cnt<K:
    if S[j]=='o':
      r_l[j] = 1
      cnt += 1
      j -= C
    j -= 1
  ans = []
  c_lr = 0
  c_rl = 0
  for i in range(1,N+1):
    if l_r[i-1]:
      c_lr += 1
    if r_l[i-1]:
      c_rl += 1
    if l_r[i-1]*r_l[i-1]==1 and c_lr==c_rl:
      ans.append(i)
  return ans
print(*solve(),sep='\n')

Solution (Python):
n, k, c = map(int,input().split())
s = list(input())

i, cnt = 0, 0
l = []
while cnt < k:
    if s[i] == 'o':
        l.append(i+1)
        cnt += 1
        i += c
    i += 1

i, cnt = n-1, 0
r = []
while cnt < k:
    if s[i] == 'o':
        r.append(i+1)
        cnt += 1
        i -= c
    i -= 1

r.sort()
for i in range(len(r)):
    if l[i] == r[i]:
        print(r[i])

Solution (Python):
n, k, c = map(int,input().split())
s = list(input())

i, cnt = 0, 0
l = []
while cnt < k:
    if s[i] == 'o':
        l.append(i+1)
        cnt += 1
        i += c
    i += 1

i, cnt = n-1, 0
r = []
while cnt < k:
    if s[i] == 'o':
        r.append(i+1)
        cnt += 1
        i -= c
    i -= 1

r.sort()
for i in range(len(r)):
    if l[i] == r[i]:
        print(r[i])

Solution (Python):
n, k, c = map(int, input().split())
s = input()

left = []
right = []

i = 0
while i < n:
    if s[i] == 'o':
        left.append(i)
        i += c
        if len(left) == k:
            break
    i += 1
i = n - 1
while i >= 0:
    if s[i] == 'o':
        right.append(i)
        i -= c
        if len(right) == k:
            break
    i -= 1
right.reverse()
ans = []
for i, j in zip(left, right):
    if i == j:
        ans.append(i)
for x in ans:
    print(x + 1)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k,c = inpm()
s = input()

saisoku = [0] * n
saioso = [0] * n

i = 0
while i < n:
    if s[i] == "x":
        i += 1
        continue
    saisoku[i] = 1
    i += c + 1

if saisoku.count(1) > k:
    exit()

i = n-1
while i >= 0:
    if s[i] == "x":
        i -= 1
        continue
    saioso[i] = 1
    i -= c + 1

for i in range(n):
    if saisoku[i] == 1 and saioso[i] == 1:
        print(i + 1)

Solution (Python):
def assign(s, n, k, c):
    res = []
    i = 0
    while k > 0 and i < n:
        if s[i] == 'o':
            res.append(i)
            k -= 1
            i += c
        i += 1
    return res


n, k, c = map(int, input().split())
s = input()
a = assign(s, n, k, c)
b = assign(s[::-1], n, k, c)[::-1]
c = [n-x-1 for x in b]

for x, y in zip(a, c):
    if x == y:
        print(x + 1)

Solution (Python):
import sys

input=sys.stdin.buffer.readline





def RD(): return sys.stdin.read()


def II(): return int(input())


def MI(): return map(int,input().split())


def MF(): return map(float,input().split())


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


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))



def main():
	n,k,c=MI()
	s=input().rstrip().decode()
	
	kk=k
	i=0
	L=[]
	while kk:
		if s[i]=="o":
			L.append(i+1)
			i+=c+1
			kk-=1
		else:
			i+=1
		
	kk=k
	i=n-1
	R=[]
	while kk:
		if s[i]=="o":
			R.append(i+1)
			i-=c+1
			kk-=1
		else:
			i-=1
	R.sort()
	
	for i,j in zip(L,R):
		if i==j:
			print(i)
	
	
	
	
	
	
	
	

if __name__=="__main__":
	main()

Solution (Python):
import sys

input=sys.stdin.buffer.readline





def RD(): return sys.stdin.read()


def II(): return int(input())


def MI(): return map(int,input().split())


def MF(): return map(float,input().split())


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


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))



def main():
	n,k,c=MI()
	s=input().rstrip().decode()
	
	kk=k
	i=0
	L=[]
	while kk:
		if s[i]=="o":
			L.append(i+1)
			i+=c+1
			kk-=1
		else:
			i+=1
		
	kk=k
	i=n-1
	R=[]
	while kk:
		if s[i]=="o":
			R.append(i+1)
			i-=c+1
			kk-=1
		else:
			i-=1
	R.sort()
	
	for i,j in zip(L,R):
		if i==j:
			print(i)
	
	
	
	
	
	
	
	

if __name__=="__main__":
	main()

Solution (Python):
n,k,c = map(int,input().split())
S = list(input())
L = [0]*k
nx = -1
cnt = 0
for i,s in enumerate(S):
    if i <=nx: continue
    if s =='o':
        L[cnt] = i
        nx = i + c
        cnt += 1
        if cnt ==k: break
R = [0]*k
nx = -1
cnt = 0
for i,s in enumerate(S[::-1]):
    if i <=nx: continue
    if s =='o':
        R[cnt] = n-i-1
        nx = i + c
        cnt += 1
        if cnt ==k: break
for l,r in zip(L,R[::-1]):
    if l ==r:print(l+1)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K, C = mapint()
S = list(input())
from heapq import heappop, heappush
from itertools import accumulate

Q = []
left = [0]*K
nx = -1
cnt = 0
for i, s in enumerate(S):
    if i<=nx: continue
    if s=='o':
        left[cnt] = i
        nx = i+C
        cnt += 1
        if cnt==K:
            break
right = [0]*K
nx = -1
cnt = 0
for i, s in enumerate(S[::-1]):
    if i<=nx: continue
    if s=='o':
        right[cnt] = N-i-1
        nx = i+C
        cnt += 1
        if cnt==K:
            break

for l, r in zip(left, right[::-1]):
    if l==r:
        print(l+1)

Solution (Python):
N,K,C=map(int,input().split())
S=input()

L=[-1]*K
R=[-1]*K

ind=0
for i in range(N):
  if S[i]=="o":
    if ind>0 and i-L[ind-1]<=C:
      continue
    else:
      L[ind]=i
      ind+=1
  if ind==K:
    break
      
ind=K-1
for i in range(N):
  j = N-1-i
  if S[j]=="o":
    if ind<K-1 and R[ind+1]-j<=C:
      continue
    else:
      R[ind]=j
      ind-=1
  if ind==-1:
    break
ans=[]
for i in range(K):
  if L[i]==R[i]:
    ans.append(L[i]+1)
if not ans:
  exit()

for a in ans:
  print(a)

Solution (Python):
N, K, C = map(int, input().split())
S = input()

s = []

count = 0
for i in range(N):
    if len(s) == K:
        break
    if count == 0:
        if S[i] == 'x':
            continue
        else:
            count = C
            s.append(i+1)
    else:
        count -= 1
s2 = []
count = 0
for i in range(N-1, -1, -1):
    if len(s2) == K:
        break
    if count == 0:
        if S[i] == 'x':
            continue
        else:
            s2.append(i+1)
            count = C
    else:
        count -= 1

for a, b in zip(s, s2[::-1]):
    if a == b:
        print(a)

Solution (Python):
INF = 1 << 60

n, k, c = map(int, input().split())
s = input()

left = []
b = -INF
cnt1 = 0
for i in range(n):
    if cnt1 == k:
        break
    if s[i] == "x":
        continue
    if b + c < i:
        b = i
        cnt1 += 1
        left.append(i)

right = []
b2 = INF
cnt2 = 0
for i in reversed(range(n)):
    if cnt2 == k:
        break
    if s[i] == "x":
        continue   
    if b2 - c > i:
        b2 = i
        cnt2 += 1
        right.append(i)

right = right[::-1]



m = len(left)
ans = []
for i in range(m):
    if right[i] == left[i]:
        ans.append(right[i])
for i in ans:
    print(i + 1)

Solution (Python):
N,K,C = map(int,input().split())
S = str(input())

L = [] 
R = []
now = 0
times = 0
while times < K:
  
  if S[now] == "o":
    L.append(now)
    now += C
    times += 1
  now += 1

now = N-1
times = 0
while times < K:
  if S[now] == "o":
    R.append(now)
    now -= C
    times +=1
  now -= 1
R.sort()


for i in range(K):
  if L[i] == R[i]:
    print(L[i]+1)

Solution (Python):
N, K, C = map(int, input().split())
S = input()
count = 0
day = 0
pre_list = []
while count < K:
    if S[day] == "o":
        pre_list.append(day + 1)
        day += C
        count += 1
    day += 1

count = 0
day = N-1
post_list = []
while count < K:
    if S[day] == "o":
        post_list.append(day+1)
        day -= C
        count += 1
    day -= 1
post_list.reverse()

ans = []
for i in range(K):
    if pre_list[i] == post_list[i]:
        ans.append(pre_list[i])

for a in ans:
    print(a)

Solution (Python):
N,K,C = list(map(int,input().split()))
S = list(input())
L = []
R = []
life = 0
cnt = K
for i in range(N):
    if cnt==0:
        break
    if S[i]=="o":
        if life <= 0:
            life = C
            L.append(i)
            cnt += -1
        else:
            life += -1
    elif S[i]=="x":
        life += -1

life = 0
cnt = K
for i in range(N):
    if cnt==0:
        break
    if S[N-1-i]=="o":
        if life <= 0:
            life = C
            R.append(N-1-i)
            cnt += -1
        else:
            life += -1
    elif S[N-1-i]=="x":
        life += -1

L.sort()
R.sort()
for i in range(min(len(L),len(R))):
    if L[i]==R[i]:
        print(L[i]+1)