Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
from bisect import bisect_left

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

last = deque()
pre = -C - 1
for i, s in enumerate(reversed(S)):
  if i > pre + C and s == 'o':
    last.appendleft(N - 1 - i)
    pre = i
    if len(last) == K:
      break
lastset = set(last)

count = 0
pre = -C - 1
for i, s in enumerate(S):
  if i > pre + C and s == 'o':
    if i in lastset and count <= bisect_left(last, i) + 1:
      print(i + 1)
    pre = i
    count += 1
    if count == K:
      break

Fixed submission:
from collections import deque

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

last = deque()
pre = -C - 1
for i, s in enumerate(reversed(S)):
  if i > pre + C and s == 'o':
    last.appendleft(N - 1 - i)
    pre = i
    if len(last) == K:
      break

count = 0
pre = -C - 1
x = last.popleft()
for i, s in enumerate(S):
  if i > pre + C and s == 'o':
    count += 1
    while x < i:
      x = last.popleft()
    if x == i and count + len(last) == K:
      print(i + 1)
    pre = i
    if count == K:
      break

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
from bisect import bisect_left

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

last = deque()
pre = -C - 1
for i, s in enumerate(S[::-1]):
  if i > pre + C and s == 'o':
    last.appendleft(N - 1 - i)
    pre = i
    if len(last) == K:
      break
lastset = set(last)

count = 0
pre = -C - 1
for i, s in enumerate(S):
  if i > pre + C and s == 'o':
    if i in lastset and count <= bisect_left(last, i) + 1:
      print(i + 1)
    pre = i
    count += 1
    if count == K:
      break

Fixed submission:
from collections import deque

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

last = deque()
pre = -C - 1
for i, s in enumerate(reversed(S)):
  if i > pre + C and s == 'o':
    last.appendleft(N - 1 - i)
    pre = i
    if len(last) == K:
      break

count = 0
pre = -C - 1
x = last.popleft()
for i, s in enumerate(S):
  if i > pre + C and s == 'o':
    count += 1
    while x < i:
      x = last.popleft()
    if x == i and count + len(last) == K:
      print(i + 1)
    pre = i
    if count == K:
      break

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
from bisect import bisect_left

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

first = deque()
pre = -C - 1
for i, s in enumerate(S):
  if i > pre + C and s == 'o':
    first.append(i)
    pre = i
    if len(first) == K:
      break
firstset = set(first)

last = deque()
pre = -C - 1
for i, s in enumerate(S[::-1]):
  if i > pre + C and s == 'o':
    last.appendleft(N - 1 - i)
    pre = i
    if len(last) == K:
      break
lastset = set(last)

for i, s in enumerate(S):
  if s == 'o':
    if i not in firstset or i not in lastset:
      continue
    if bisect_left(first, i) <= bisect_left(last, i):
      print(i + 1)

Fixed submission:
from collections import deque

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

last = deque()
pre = -C - 1
for i, s in enumerate(reversed(S)):
  if i > pre + C and s == 'o':
    last.appendleft(N - 1 - i)
    pre = i
    if len(last) == K:
      break

count = 0
pre = -C - 1
x = last.popleft()
for i, s in enumerate(S):
  if i > pre + C and s == 'o':
    count += 1
    while x < i:
      x = last.popleft()
    if x == i and count + len(last) == K:
      print(i + 1)
    pre = i
    if count == K:
      break