Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N = int(input())

P = list(map(int, input().split()))

P = [0] + P
P_ = [0] * len(P)
     
count = 0
for i in range(1, N+1):
    P_[P[i]] = 1
    if sum(P_[:P[i]]) > 0:
        continue
    count += 1

print(count)

### FIXED CODE ###

N = int(input())

P = list(map(int, input().split()))

P = [0] + P
     
count = 0
min = 10000000000000
for i in range(1, N+1):
    if min > P[i]:
        min = P[i]
    elif min < P[i]:
        continue
    """
    for j in range(1, i+1):
        #print(i, P[i], j , P[j])
        if P[i] > P[j]:
            #print("out", i)
            break
    else:
        #print("ok", i)
        count += 1
    """
    count += 1
        
    if P[i] == 1:
        break

print(count)
### BUGGY CODE ###

N = int(input())
As = list(map(int, input().split()))
Q = int(input())

sumAs = sum(As)

for _ in range(Q):
  b, c = map(int, input().split())
  for i in range(len(As)):
    if As[i] == b:
      As[i] = c
      sumAs = sumAs - b + c
  print(sumAs)
  


### FIXED CODE ###

N = int(input())
As = list(map(int, input().split()))
Q = int(input())
 
sumAs = 0
dictAs = [0] * 100000
for i in range(len(As)):
  sumAs += As[i]
  dictAs[As[i] - 1] += 1


for _ in range(Q):
  b, c = map(int, input().split())
  sumAs += dictAs[b - 1] * (c - b)
  dictAs[c - 1] += dictAs[b - 1]
  dictAs[b - 1] = 0
  print(sumAs)
### BUGGY CODE ###

import numpy

N,K=map(int,input().split())
p=list(map(int,input().split()))
ans = 0
tmp = [0]*N
tmp2 = 0

for i in range(N):
  if len(p)<i+K:
    break
  for j in range(i,i+K):
    tmp[i]=tmp[i]+p[j]

max_index=numpy.argmax(tmp)
for i in range(max_index,max_index+K):
  for j in range(1,p[i]+1):
    ans=ans+float(j*(1/p[i]))
print(ans)

### FIXED CODE ###

import numpy
 
N,K=map(int,input().split())
p=list(map(int,input().split()))
ans = 0
tmp = [0]*(N-K+1)

for i in range(K):
  tmp[0] = tmp[0]+p[i]

for i in range(1,N-K+1):
  tmp[i]=tmp[i-1]-p[i-1]+p[i+K-1]

max_index=numpy.argmax(tmp)
for i in range(max_index,max_index+K):
  ans=ans+float(((p[i]*(p[i]+1))/2)*1/p[i])
print(ans)
### BUGGY CODE ###

# -*- coding:utf-8 -*-
import sys


class Hash(object):
    def __init__(self, size):
        self._array = [None] * size
        self._size = size

    def _h1(self, key):
        return key % self._size

    def _h2(self, key):
        return 1 + (key % (self._size - 1))

    def _hash(self, key, i):
        return (self._h1(key) + i * self._h2(key)) % self._size

    def insert(self, key, value):
        i = 0
        while 1:
            j = self._hash(key, i)
            if self._array[j] is None:
                self._array[j] = value
                break
            else:
                i += 1

    def find(self, key, value):
        i = 0
        while 1:
            j = self._hash(key, i)
            if self._array[j] == value:
                return True
            elif self._array[j] is None or i >= self._size:
                return False
            else:
                i += 1


def stoi(s):
    ret = 0
    p = 1
    ctoi = {"A": 1, "C": 2, "G": 3, "T": 4}
    for c in s:
        ret += ctoi[c] * p
        p *= 5
    return ret


def dictionary(lst):
    h = Hash(1046527)
    ret = []
    for val in lst:
        if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
    return ret


if __name__ == "__main__":
    lst = [val.split() for val in sys.stdin.read().splitlines()]
    n = int(lst.pop(0)[0])
    print("\n".join(dictionary(lst)))

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys


class Hash(object):
    def __init__(self, size):
        self._array = [None] * size
        self._size = size

    def _hash(self, key):
        return key % self._size

    def insert(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            self._array[j] = [value]
        else:
            self._array[j].append(value)

    def find(self, key, value):
        j = self._hash(key)
        if self._array[j] is None:
            return False
        elif value in self._array[j]:
            return True
        else:
            return False


def stoi(s):
    ret = 0
    p = 1
    ctoi = {"A": 1, "C": 2, "G": 3, "T": 4}
    for c in s:
        ret += ctoi[c] * p
        p *= 7
    return ret


def dictionary(lst):
    h = Hash(1046527)
    ret = []
    for val in lst:
        if val[0] == "insert":
            h.insert(stoi(val[1]), val[1])
        elif val[0] == "find":
            if h.find(stoi(val[1]), val[1]):
                ret.append("yes")
            else:
                ret.append("no")
        else:
            raise ValueError
    return ret


if __name__ == "__main__":
    lst = [val.split() for val in sys.stdin.read().splitlines()]
    n = int(lst.pop(0)[0])
    print("\n".join(dictionary(lst)))
### BUGGY CODE ###

import sys
import numpy as np

def read():
    return sys.stdin.readline().rstrip()

def main():
    h, w = map(int, read().split())
    s = [list(read()) for _ in range(h)]
    l = np.zeros((h, w), dtype=int)
    r = np.zeros((h, w), dtype=int)
    u = np.zeros((h, w), dtype=int)
    d = np.zeros((h, w), dtype=int)
    for i in range(h):
        for j in range(w):
            if s[i][j] == ".":
                l[i][j] = l[i][j - 1] + 1 if j > 0 else 1
                u[i][j] = u[i - 1][j] + 1 if i > 0 else 1
            if s[h - 1 - i][w - 1 - j] == ".":
                r[h - 1 - i][w - 1 - j] = r[h - 1 - i][w - j] + 1 if j > 0 else 1
                d[h - 1 - i][w - 1 - j] = d[h - i][w - 1 - j] + 1 if i > 0 else 1
    print((l + r + u + d).max() - 3)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

def read():
    return sys.stdin.readline().rstrip()

def main():
    h, w = map(int, read().split())
    s = [list(read()) for _ in range(h)]
    row = [[0 for _ in range(w)] for _ in range(h)]
    col = [[0 for _ in range(w)] for _ in range(h)]
    for i in range(h):
        c = 0
        for j in range(w):
            if s[i][j] == "#":
                for k in range(j - c, j):
                    row[i][k] = c
                c = 0
            else:
                c += 1
        for k in range(w - c, w):
            row[i][k] = c
    for i in range(w):
        c = 0
        for j in range(h):
            if s[j][i] == "#":
                for k in range(j - c, j):
                    col[k][i] = c
                c = 0
            else:
                c += 1
        for k in range(h - c, h):
            col[k][i] = c
    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(row[i][j] + col[i][j], ans)
    print(ans - 1)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N, S = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353
a.sort()
#print(a)
dp = [0] * (S + 1)
dp[0] = 1
for i in range(N):
  for x in range(S, -1, -1):
    if dp[x] == 0: continue
    if x + a[i] <= S:
      dp[x + a[i]] += dp[x] * pow(2, mod - 2, mod)
      dp[x + a[i]] %= mod
print(dp[-1] * pow(2, N, mod) % mod)

### FIXED CODE ###

import sys
input = sys.stdin.readline
N, S = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353
#print(a)
dp = [0] * (S + 1)
dp[0] = 1
md = pow(2, mod - 2, mod)
for i in range(N):
  for x in range(S, -1, -1):
    if dp[x] == 0: continue
    if x + a[i] <= S:
      dp[x + a[i]] += dp[x] * md % mod
      dp[x + a[i]] %= mod
print(dp[-1] * pow(2, N, mod) % mod)
### BUGGY CODE ###

s=input()
q=int(input())
order=1
for _ in range(q):
  tmp=input()
  if tmp=='1':
    order*=-1
  else:
    t, f, c=tmp.split()
    if (int(f)*order)%3==1:
      s=c+s
    else:
      s=s+c
print(s) if order==1 else print(s[::-1])

### FIXED CODE ###

s=input()
q=int(input())
order=1
header=''
footer=''
for _ in range(q):
  tmp=input()
  if tmp=='1':
    order*=-1
  else:
    t, f, c=tmp.split()
    if (int(f)*order)%3==1:
      header=c+header
    else:
      footer=footer+c
s=header+s+footer
print(s) if order==1 else print(s[::-1])
### BUGGY CODE ###

data = input()
counter=1
while data != 0:
    print("Case" + str(counter) + ":" + str(data))
print("Case"+counter+":"+data)

### FIXED CODE ###

data = input()
counter=1
while data != 0:
    print("Case %d: %d" % (counter, data))
    data = input()
    counter+=1
### BUGGY CODE ###

#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
cnt = n = int(stdin.readline())
for _ in range(n):
    v = int(stdin.readline())
    if v == 2:
        continue
    elif v % 2 == 0:
        cnt -= 1
    else:
        for i in xrange(3, v//2, 2):
            if v % i == 0:
                cnt -= 1
                break
print(cnt)

### FIXED CODE ###

#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
from math import sqrt
n = int(stdin.readline())
cnt = 0
for _ in range(n):
    v = int(stdin.readline())
    if v == 2:
        cnt += 1
    elif v % 2 == 1:
        for i in xrange(3, int(sqrt(v))+1, 2):
            if v % i == 0:
                break
        else:
            cnt += 1
print(cnt)
### BUGGY CODE ###

h1, m1, h2, m2, k = map(int, input().split())
h = h2-h1
m = m2-m1
a = h*60
m += a
b = k
if k != m:
    while k+b != m:
        if k+b == m:
            k = 0
            break
        k += b
else:
    k = 0
print(k)



### FIXED CODE ###

h1, m1, h2, m2, k = map(int, input().split())
print(60*(h2-h1) + m2-m1-k)
### BUGGY CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))

left = [[0 for _ in range(N)] for _ in range(N)]
right = [[] for _ in range(N)]
for i in range(N):
  right[i].append(A[i] * 2)
  for j in range(N):
    if j == i or j == (i + 1) % N:
      left[i][j] = 1

A = np.matrix(left)
Y = np.matrix(right)
ans = np.dot(np.linalg.inv(A), Y)

for i in range(N):
  print(int(round(ans[i,0])), end = "")
  if i == N - 1:
    print()
  else:
    print(" ", end = "")

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(N):
  tmp = ans
  if i == 0:
    for j in range(N):
      if j % 2 == 0:
        ans += A[j]
      else:
        ans -= A[j]
  else:
    ans = 2 * A[i - 1] - tmp

  tmp = ans
  print(ans, end = "")
  if i != N - 1:
    print(" ", end = "")
  else:
    print()
### BUGGY CODE ###

# https://atcoder.jp/contests/abc159/tasks/abc159_e
import sys

ans = sys.maxsize
H, W, K = map(int, input().split())
s = [input() for _ in range(H)]
c = [[0 for _ in range(W)] for _ in range(10)]

for h in range(1 << (H - 1)):
    g = 0
    ids = [-1 for _ in range(H)]
    for i in range(H):
        ids[i] = g
        if (h >> i) & 1:
            g += 1

    g += 1
    for i in range(W):
        for j in range(g):
            c[j][i] = 0

    for i in range(H):
        for j in range(W):
            c[ids[i]][j] = c[ids[i]][j] + (s[i][j] == '1')

    num = g - 1
    now = [0 for _ in range(g)]


    def add(j):
        for i in range(g):
            now[i] += c[i][j]

        for i in range(g):
            if now[i] > K:
                return False

        return True


    if num >= ans:
        continue

    for j in range(W):
        if not add(j):
            num += 1
            if num >= ans:
                continue
            now = [0 for _ in range(g)]
            if not add(j):
                num = sys.maxsize
                break

    ans = min(ans, num)

print(ans)


### FIXED CODE ###

# https://atcoder.jp/contests/abc159/tasks/abc159_e
import sys

ans = sys.maxsize
H, W, K = map(int, input().split())
s = [input() for _ in range(H)]

for h in range(1 << (H - 1)):
    g = 0
    ids = [-1 for _ in range(H)]
    for i in range(H):
        ids[i] = g
        if (h >> i) & 1:
            g += 1

    g += 1
    c = [[0 for _ in range(W)] for _ in range(g)]
    for i in range(H):
        for j in range(W):
            c[ids[i]][j] = c[ids[i]][j] + (s[i][j] == '1')

    num = g - 1
    now = [0 for _ in range(g)]


    def add(j):
        for i in range(g):
            now[i] += c[i][j]

        for i in range(g):
            if now[i] > K:
                return False

        return True

    if num >= ans:
        continue

    for j in range(W):
        if not add(j):
            num += 1
            if num >= ans:
                continue
            now = [0 for _ in range(g)]
            if not add(j):
                num = sys.maxsize
                break

    ans = min(ans, num)

print(ans)
### BUGGY CODE ###

n, x, y = map(int, input().split())
num_list = list(range(1,n+1))

ans_list = []

for i in range(1, n):
  for j in range(2, n+1):
    ans1 = j - i
    ans2 = abs(x-i) + 1 + abs(y-j)
    ans = min(ans1, ans2)
    ans_list.append(ans)

for i in range(1, n):
  print(ans_list.count(i))

### FIXED CODE ###

n, x, y = map(int, input().split())
num_list = list(range(1,n+1))

ans_list = [0] * (n-1)

for i in range(1, n):
  for j in range(i+1, n+1):
    ans = min(j - i, abs(x-i) + 1 + abs(y-j))
    ans_list[ans-1] += 1

for i in range(n-1):
  print(ans_list[i])
### BUGGY CODE ###

#16:38
n,m = map(int,input().split())
raw = [[] for _ in range(n)]
root = [1 for _ in range(n)]
for _ in range(n-1+m):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  raw[a].append(b)
  root[b] = 0
for i in range(n):
  if root[i] == 1:
    r = i
    break
pre = [-1 for _ in range(n)]
now = [r]
while now:
  last = now
  now = []
  for x in last:
    for y in raw[x]:
      if pre[x] == y:
        continue
      pre[y] = x
      now.append(y)
print('\n'.join(map(lambda x: str(x+1) ,pre)))

### FIXED CODE ###

#16:38
n,m = map(int,input().split())
raw = [[] for _ in range(n)]
precnt = [0 for _ in range(n)]
root = [1 for _ in range(n)]
for _ in range(n-1+m):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  raw[a].append(b)
  precnt[b] += 1
  root[b] = 0
for i in range(n):
  if root[i] == 1:
    r = i
    break
pre = [-1 for _ in range(n)]
now = [r]
#print(precnt)
while now:
  last = now
  now = []
  for x in last:
    for y in raw[x]:
      precnt[y] -= 1
      if precnt[y] == 0:
        now.append(y)
      pre[y] = x
#print(pre)
#print(precnt)
for x in pre:
  print(x+1)
### BUGGY CODE ###

import heapq
n = int(input())
a = list(map(int, input().split()))

ans = -float('inf')
for i in range(n+1):
  fh = list(map(lambda x:x, a[:n+i]))
  sh = a[n+i:]
  heapq.heapify(fh)
  heapq.heapify(sh)
  ans = max(ans, sum(heapq.nlargest(n, fh))-sum(heapq.nsmallest(n, sh)))

print(ans)

### FIXED CODE ###

from heapq import heappush, heappop, heapify
N = int(input())
a = list(map(int, input().split()))
ans_list = []
def red_sum():
  red = sum(a[:N])
  pqr = a[:N]
  heapify(pqr)
  ans_list.append(red)
  for i in range(N, 2*N):
    heappush(pqr, a[i])
    red += a[i]-heappop(pqr)
    ans_list.append(red)

def blue_sum():
  blue = sum(a[2*N:])
  pqb = [-a[i] for i in range(2*N, 3*N)]
  heapify(pqb)
  ans_list[N] -= blue
  for i in range(2*N-1, N-1, -1):
    heappush(pqb, -a[i])
    tmp = heappop(pqb)
    blue += a[i]+tmp
    ans_list[i-N] -= blue

red_sum()
blue_sum()
print(max(ans_list))
### BUGGY CODE ###

from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict
from functools import lru_cache

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

setrecursionlimit(10001)

def main():
	MOD = 10**9 + 7
	k, d = int(rl()), int(rl())
	ans = 0

	@lru_cache(None)
	def dfs(x, tight, i, tot):
		if i == len(x):
			return 1 if tot == 0 else 0
		maxdig = x[i] if tight else 9
		cnt = 0
		for dig in range(0, maxdig + 1):
			ntight = 1 if tight and dig == x[i] else 0
			cnt += dfs(x, ntight, i + 1, (tot + dig) % d)
		return cnt % MOD

	def totup(num):
		ans = deque()
		while num:
			num, dig = divmod(num, 10)
			ans.appendleft(dig)
		return tuple(ans)

	tupk = totup(k)
	ans += dfs(tupk, 1, 0, 0) - 1
	print(ans % MOD)

	stdout.close()

if __name__ == "__main__":
	main()

### FIXED CODE ###

from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict
from functools import lru_cache

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

setrecursionlimit(100000)

def main():
	MOD = 10**9 + 7
	k, d = int(rl()), int(rl())
	ans = 0

	def totup(num):
		ans = deque()
		while num:
			num, dig = divmod(num, 10)
			ans.appendleft(dig)
		return tuple(ans)

	x = totup(k)

	dp = [[[0]*2 for j in range(d)] for i in range(len(x)+1)]
	dp[0][0][1] = 1
	for i in range(len(x)):
		for digsum in range(d):
			for tight in range(2):
				for dig in range(x[i]+1 if tight else 10):
					ns = (digsum + dig) % d 
					ntight = 1 if tight and dig == x[i] else 0
					dp[i+1][ns][ntight] += dp[i][digsum][tight]
					dp[i+1][ns][ntight] %= MOD

	ans = (dp[len(x)][0][0] + dp[len(x)][0][1] - 1) % MOD
	print(ans)
	stdout.close()

if __name__ == "__main__":
	main()
### BUGGY CODE ###

from itertools import product

n = int(input())
P = [0, 0] + [int(i) for i in input().split()]
X = [0] + [int(i) for i in input().split()]

C = [[] for i in range (n+1)]

for i, p in enumerate(P):
    C[p].append(i)

def dfs(i):
    if not C[i]:
        return X[i], 0

    A = []
    
    for c in C[i]:
        A.append(dfs(c))

    S = 0
    for a in A:
        S += sum(a)

    B = []
    for bits in range(2**(len(A))):
        a = 0
        for j, c in enumerate(A):
            a += c[bits >> j & 1]
            if a > X[i]:
                break
        if a <= X[i]:
            B.append(a)
    if not B:
        print('IMPOSSIBLE')
        exit()

    return X[i], S - max(B)

dfs(1)
print('POSSIBLE')

### FIXED CODE ###

from itertools import product

n = int(input())
P = [0, 0] + [int(i) for i in input().split()]
X = [0] + [int(i) for i in input().split()]

C = [[] for i in range (n+1)]

for i, p in enumerate(P):
    C[p].append(i)

def dfs(i):
    if not C[i]:
        return X[i], 0

    A = []
    
    for c in C[i]:
        A.append(dfs(c))

    S = 0
    for a in A:
        S += sum(a)

    dp = [[False]*(X[i]+1) for j in range(len(A)+1)]
    dp[0][0] = True

    for j in range(len(A)):
        for k in range(X[i]+1):
            a, b = A[j]
            if a <= k and dp[j][k-a]:
                dp[j+1][k] = True
            elif b <= k and dp[j][k-b]:
                dp[j+1][k] = True
        if not any(dp[j+1]):
            print('IMPOSSIBLE')
            exit()

    b = 0
    for j in range(X[i], -1, -1):
        if dp[len(A)][j]:
            b = j
            break

    return X[i], S - b

dfs(1)
print('POSSIBLE')
### BUGGY CODE ###

import itertools

n = int(input())
num_list = input().split()

mod_base = 10 ** 9 + 7

num_list = [int(x) for x in num_list]

def calc_list(i, num_list):
    return num_list[i] * sum(num_list[i+1:])

sum_num = 0

for i, num_str in enumerate(num_list):
    if i+1 > len(num_list):
        break
    sum_num += calc_list(i, num_list)
    
print(sum_num % mod_base)

### FIXED CODE ###

import itertools

n = int(input())
num_list = input().split()

mod_base = 10 ** 9 + 7

num_list = [int(x) for x in num_list]

sum_list = []
sum_tmp = sum(num_list)
for i in range(len(num_list)):
    sum_list.append(sum_tmp)
    sum_tmp -= num_list[i]

all_sum = 0
for index, num in enumerate(num_list):
    if index + 1 >= len(num_list):
        break
    all_sum += num * sum_list[index+1]

print(all_sum % mod_base)
### BUGGY CODE ###

import numpy as np
import copy

N = int(input())
h = list(map(int, input().split()))
h2 = copy.copy(h)
ans = 0
for i in range(N):
    h2.remove(h[i])
    ans += h[i] * np.sum(h2)
    ans = ans % (10 ** 9 + 7)
print(int(ans))

### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
ans = 0
s = [h[N-1]]
for i in range(1, N):
    s.append(s[-1] + h[-i-1])
for i in range(N-1):
    ans += h[i] * s[-i-2]
ans = ans % (10 ** 9 + 7)
print(int(ans))
### BUGGY CODE ###

N = int(input())

def ff(n):
    ans = 0
    for x in range(1,n):
        for y in range(1,x+1):
            for z in range(1, y+1):
                if x*x + y*y + z*z + x*y + y*z + z*x == n:
                    if x == y and y == z and z == x:
                        ans +=1
                    elif x == y or y == z or z == x:
                        ans += 3
                    else:
                        ans += 6
    return ans
for i in range(1, N+1):                                      
    print(ff(i))

### FIXED CODE ###

N = int(input())
n = 10**4
tmp = [0]*((10**4)+1)
for x in range(1,int(-(-n**0.5//1))+1):
    for y in range(1,x+1):
        for z in range(1, y+1):
            if x*x + y*y + z*z + x*y + y*z + z*x <= 10**4:
                if x == y and y == z and z == x:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x] +=1
                elif x == y or y == z or z == x:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x]  += 3
                else:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x]  += 6
for i in range(1, N+1):
    print(tmp[i])
### BUGGY CODE ###

import itertools

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

S_OK = [i for i, x in enumerate(S) if x == 'o']
SF, SL = S_OK.copy(), S_OK.copy()
F = []
L = []

for j in range(K):
    F.append(SF[0])
    SF = [i for i in SF if SF[0] + C < i]
    L.insert(0, SL[-1])
    SL = [i for i in SL if SL[-1] - C > i]

# del F[-1]
# del L[0]

for i in F:
    if i in L:
        print(i+1)

### FIXED CODE ###

# import time

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

F = []
L = []

# t1 = time.time()
# for i in range(N):
#     if S[i] == 'o':
#         if len(F) == 0:
#             F.append(i)
#         elif F[-1] + C < i:
#             F.append(i)
#     if len(F) >= K:
#         break
# print(F)
# t2 = time.time()
i = 0
while len(F) <= K and i < N:
    if S[i] == 'o':
        if len(F) == 0:
            F.append(i)
        elif F[-1] + C < i:
            F.append(i)
    i += 1
# print(F)
# t3 = time.time()

# print(t2 - t1, t3 - t2)

i = N - 1
while len(L) <= K and i >= 0:
    if S[i] == 'o':
        if len(L) == 0:
            L.append(i)
        elif L[-1] - C > i:
            L.append(i)
    i -= 1

if len(F) == K and len(L) == K:
    ans = [i + 1 for i in set(F) & set(L)]
    if len(ans) != 0:
        ans.sort()
        [print(i) for i in ans]