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

F_list = []
B_list = []

f_count = 0
b_count = 0
f_rest = 0
b_rest = 0
S_len = len(S)

for i in range(S_len):
    if f_count == K and b_count == K:
        break

    if f_count < K:
        if S[i] == "o" and f_rest == 0:
            f_rest += C
            f_count += 1
            F_list.append(i+1)
        else:
            if f_rest > 0:
                f_rest -= 1
    if b_count < K:
        if S[-(i+1)] == "o" and b_rest == 0:
            b_rest += C
            b_count += 1
            B_list.append(S_len-i)
        else:
            if b_rest > 0:
                b_rest -= 1


for i in F_list:
    if i in B_list:
        print(i)

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

F_list = []
B_list = []

f_count = 0
b_count = 0
f_rest = 0
b_rest = 0
S_len = len(S)
# o
for i in range(S_len):
    if f_count == K and b_count == K:
        break

    if f_count < K:
        if S[i] == "o" and f_rest == 0:
            f_rest += C
            f_count += 1
            F_list.append(i+1)
        else:
            if f_rest > 0:
                f_rest -= 1
    if b_count < K:
        if S[-(i+1)] == "o" and b_rest == 0:
            b_rest += C
            b_count += 1
            B_list.append(S_len-i)
        else:
            if b_rest > 0:
                b_rest -= 1

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

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

F_list = []
B_list = []

count = 0
add_count = 0
S_len = len(S)
while count < S_len and add_count < K:
    if S[count] == "o":
        add_count += 1
        F_list.append(count+1)
        count += C+1
    else:
        count += 1

count = 0
add_count = 0

while count < S_len and add_count < K:
    if S[-(count+1)] == "o":
        add_count += 1
        B_list.append(S_len-count)
        count += C+1
    else:
        count += 1


for i in F_list:
    if i in B_list:
        print(i)


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

F_list = []
B_list = []

f_count = 0
b_count = 0
f_rest = 0
b_rest = 0
S_len = len(S)
# o
for i in range(S_len):
    if f_count == K and b_count == K:
        break

    if f_count < K:
        if S[i] == "o" and f_rest == 0:
            f_rest += C
            f_count += 1
            F_list.append(i+1)
        else:
            if f_rest > 0:
                f_rest -= 1
    if b_count < K:
        if S[-(i+1)] == "o" and b_rest == 0:
            b_rest += C
            b_count += 1
            B_list.append(S_len-i)
        else:
            if b_rest > 0:
                b_rest -= 1

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

Buggy python submission (verdict: Time Limit Exceeded):
N, K, C = list(map(int, input().split(" ")))
S = input()
S_list = [i for i in S]

F_list = []
B_list = []
count = 0
len_S = len(S_list)
for j in range(K):
    for i in range(count, len_S):
        if S_list[i] == "o":
            F_list.append(i+1)
            count += C+1
            break
        else:
            count += 1

#S_list = S_list[::-1]

count = 0
for j in range(K):
    for i in range(count, len_S):
        if S_list[-(i+1)] == "o":
            B_list.append(len_S-i)
            count += C+1
            break
        else:
            count += 1

for i in F_list:
    if i in B_list:
        print(i)

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

F_list = []
B_list = []

f_count = 0
b_count = 0
f_rest = 0
b_rest = 0
S_len = len(S)
# o
for i in range(S_len):
    if f_count == K and b_count == K:
        break

    if f_count < K:
        if S[i] == "o" and f_rest == 0:
            f_rest += C
            f_count += 1
            F_list.append(i+1)
        else:
            if f_rest > 0:
                f_rest -= 1
    if b_count < K:
        if S[-(i+1)] == "o" and b_rest == 0:
            b_rest += C
            b_count += 1
            B_list.append(S_len-i)
        else:
            if b_rest > 0:
                b_rest -= 1

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

Buggy python submission (verdict: Time Limit Exceeded):
N, K, C = list(map(int, input().split(" ")))
S = input()
S_list = [i for i in S]

F_list = []
B_list = []
count = 0
for j in range(K):
    for i in range(count, len(S_list)):
        if S_list[i] == "o":
            F_list.append(i+1)
            count += C+1
            break
        else:
            count += 1
S_list = S_list[::-1]

count = 0
for j in range(K):
    for i in range(count, len(S_list)):
        if S_list[i] == "o":
            B_list.append(len(S_list)-i)
            count += C+1
            break
        else:
            count += 1

for i in F_list:
    if i in B_list:
        print(i)


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

F_list = []
B_list = []

f_count = 0
b_count = 0
f_rest = 0
b_rest = 0
S_len = len(S)
# o
for i in range(S_len):
    if f_count == K and b_count == K:
        break

    if f_count < K:
        if S[i] == "o" and f_rest == 0:
            f_rest += C
            f_count += 1
            F_list.append(i+1)
        else:
            if f_rest > 0:
                f_rest -= 1
    if b_count < K:
        if S[-(i+1)] == "o" and b_rest == 0:
            b_rest += C
            b_count += 1
            B_list.append(S_len-i)
        else:
            if b_rest > 0:
                b_rest -= 1

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