Buggy python submission (verdict: Time Limit Exceeded):
N,K,C=map(int,input().split())
S=list(input())

days=[]
i=0
while i<N:
    if S[i]=='o':
        days.append(i)
        i+=C
    if len(days)>=K:
        break
    i+=1

days=days[::-1]
while len(days)!=0:
    p=days.pop()
    S[p]='x'
    days2=[]
    j=0
    while j<N:
        if S[j]=='o':
            days2.append(j)
            j+=C
        if len(days2)>=K:
            break
        j+=1
    if len(days2)>=K:
        days=set(days)&set(days2)
    else:
        print(p+1)

Fixed submission:
N,K,C=map(int,input().split())
S=input()

maekara=[]
i=1
cnt=0
while i<=N and cnt<K:
    if S[i-1]=='o':
        maekara.append(i)
        i+=C+1
        cnt+=1
    else: i+=1

usirokara=[]
j=N
cnt=0
while j>=1 and cnt<K:
    if S[j-1]=='o':
        usirokara.append(j)
        j-=C+1
        cnt+=1
    else: j-=1
usirokara=usirokara[::-1]

for i in range(K):
    if maekara[i]==usirokara[i]:
        print(maekara[i])

Buggy python submission (verdict: Time Limit Exceeded):
N,K,C=map(int,input().split())
S=list(input())

#まず一つ答えをつくる これはたぶん貪欲でいける
days=[]
i=0
while i<N:
    if S[i]=='o':
        days.append(i)
        i+=C
    if len(days)>=K:
        break
    i+=1

def check(plan):
    cnt=0
    ii=0
    while ii<N:
        if plan[ii]=='o':
            cnt+=1
            ii+=C
        if cnt>=K:
            break
        ii+=1
    if cnt>=K:
        return True
    else:
        return False

p=S
for i in days:
    p[i]='x'
    if not check(p):
        print(i+1)
    p[i]='o'

Fixed submission:
N,K,C=map(int,input().split())
S=input()

maekara=[]
i=1
cnt=0
while i<=N and cnt<K:
    if S[i-1]=='o':
        maekara.append(i)
        i+=C+1
        cnt+=1
    else: i+=1

usirokara=[]
j=N
cnt=0
while j>=1 and cnt<K:
    if S[j-1]=='o':
        usirokara.append(j)
        j-=C+1
        cnt+=1
    else: j-=1
usirokara=usirokara[::-1]

for i in range(K):
    if maekara[i]==usirokara[i]:
        print(maekara[i])

Buggy python submission (verdict: Time Limit Exceeded):
N,K,C=map(int,input().split())
S=list(input())

#まず一つ答えをつくる これはたぶん貪欲でいける
days=[]
T=S.copy()
for i in range(N):
    if T[i]=='o':
        days.append(i)
        if C!=0:
            for j in range(1,C+1):
                if i+j>=N:
                    break
                T[i+j]='x'
    if len(days)>=K:
        break

def check(plan):
    cnt=0
    ii=0
    while ii<N:
        if plan[ii]=='o':
            cnt+=1
            ii+=C
        if cnt>=K:
            break
        ii+=1
    if cnt>=K:
        return True
    else:
        return False

p=S
for i in days:
    p[i]='x'
    if not check(p):
        print(i+1)
    p[i]='o'

Fixed submission:
N,K,C=map(int,input().split())
S=input()

maekara=[]
i=1
cnt=0
while i<=N and cnt<K:
    if S[i-1]=='o':
        maekara.append(i)
        i+=C+1
        cnt+=1
    else: i+=1

usirokara=[]
j=N
cnt=0
while j>=1 and cnt<K:
    if S[j-1]=='o':
        usirokara.append(j)
        j-=C+1
        cnt+=1
    else: j-=1
usirokara=usirokara[::-1]

for i in range(K):
    if maekara[i]==usirokara[i]:
        print(maekara[i])

Buggy python submission (verdict: Runtime Error):
N,K,C=map(int,input().split())
S=list(input())

#まず一つ答えをつくる これはたぶん貪欲でいける
days=[]
T=S.copy()
for i in range(N):
    if T[i]=='o':
        days.append(i)
        if C!=0:
            for j in range(1,C+1):
                if i+j>=N:
                    break
                T[i+j]='x'
    if len(days)>=K:
        break

def check(plan):
    cnt=0
    qlan=plan.copy()
    for i in range(N):
        if qlan[i]=='o':
            cnt+=1
            if C!=0:
                for j in range(1,C+1):
                    if i+j>=N:
                        break
                    qlan[i+j]='x'
        if cnt>=K:
            return True  #これなしでも成立する
            break
    return False  #これなしでは成立しない

for i in days:
    p=S
    p[i]='x'
    if not check(p):
        print(i+1)
    p[i]='o'


Fixed submission:
N,K,C=map(int,input().split())
S=input()

maekara=[]
i=1
cnt=0
while i<=N and cnt<K:
    if S[i-1]=='o':
        maekara.append(i)
        i+=C+1
        cnt+=1
    else: i+=1

usirokara=[]
j=N
cnt=0
while j>=1 and cnt<K:
    if S[j-1]=='o':
        usirokara.append(j)
        j-=C+1
        cnt+=1
    else: j-=1
usirokara=usirokara[::-1]

for i in range(K):
    if maekara[i]==usirokara[i]:
        print(maekara[i])

Buggy python submission (verdict: Time Limit Exceeded):
N,K,C=map(int,input().split())
S=list(input())

#まず一つ答えをつくる これはたぶん貪欲でいける
days=[]
T=S.copy()
for i in range(N):
    if T[i]=='o':
        days.append(i)
        if C!=0:
            for j in range(1,C+1):
                if i+j>=N:
                    break
                T[i+j]='x'
    if len(days)>=K:
        break

def check(plan):
    cnt=0
    qlan=plan.copy()
    for i in range(N):
        if qlan[i]=='o':
            cnt+=1
            if C!=0:
                for j in range(1,C+1):
                    if i+j>=N:
                        break
                    qlan[i+j]='x'
        if cnt>=K:
            return True  #これなしでも成立する
            break
    return False  #これなしでは成立しない

for i in days:
    p=S
    p[i]='x'
    if not check(p):
        print(i+1)
    p[i]='o'


Fixed submission:
N,K,C=map(int,input().split())
S=input()

maekara=[]
i=1
cnt=0
while i<=N and cnt<K:
    if S[i-1]=='o':
        maekara.append(i)
        i+=C+1
        cnt+=1
    else: i+=1

usirokara=[]
j=N
cnt=0
while j>=1 and cnt<K:
    if S[j-1]=='o':
        usirokara.append(j)
        j-=C+1
        cnt+=1
    else: j-=1
usirokara=usirokara[::-1]

for i in range(K):
    if maekara[i]==usirokara[i]:
        print(maekara[i])