Harryxun/stf_run huggingface dataset:
# coding: utf-8
from scipy.sparse.csgraph import floyd_warshall,csgraph_from_dense

MAX=float('inf')
N,M,L=map(int, input().split())
Roads = [[ 0 if i == j else MAX for j in range(N)] for i in range(N)]

for i in range(M):
    f,t,c = map(int, input().split())
    Roads[f-1][t-1] = c
    Roads[t-1][f-1] = c

RG = csgraph_from_dense(Roads, null_value=MAX)
Rd = floyd_warshall(RG)

Fuels = [[ 1 if Rd[i][j] <=L else MAX for j in range(N)] for i in range(N)]

FG = csgraph_from_dense(Fuels, null_value=MAX)
Fd = floyd_warshall(FG)

Q=int(input())
Queries = []
for i in range(Q):
    s, t = map(int, input().split())
    v = Fd[s-1][t-1]
    if v == float('inf'):
        print (str(-1))
    else:
        print (str(int(v -1)))



### FIXED CODE ###

# coding: utf-8
from scipy.sparse.csgraph import floyd_warshall

N,M,L=map(int, input().split())
RG=[[0 for i in range(N)] for j in range(N)]

for i in range(M):
    f,t,c = map(int, input().split())
    if c <= L:
        RG[f-1][t-1] = c
        RG[t-1][f-1] = c

Rd = floyd_warshall(RG, directed=False)

FG=[[0 for i in range(N)] for j in range(N)]
for i in range(N):
    for j in range(i+1, N):
        if Rd[i][j] <= L:
            FG[i][j] = 1
            FG[j][i] = 1

Fd = floyd_warshall(FG, directed=False)

Q=int(input())
for i in range(Q):
    s, t = map(int, input().split())
    v = Fd[s-1][t-1]
    if s == t:
        print (str(0))
    if v == float('inf'):
        print (str(-1))
    else:
        print (str(int(v-1)))
import numpy as np
N = int(input())

x = np.empty(N, dtype=np.longlong)
y = np.empty(N, dtype=np.longlong)

for i in range(N):
    x[i], y[i] = (int(t) for t in input().split())

ind = np.argsort(x)
X = x[ind]
Y = y[ind]

# max_dist = [0]
# for i in range(1, N):
#     max_dist.append(np.max(-X[:i] - Y[:i]) + X[i] + Y[i])
#     max_dist.append(np.max(-X[:i] + Y[:i]) + X[i] - Y[i])

# print(max(max_dist))


dist = np.abs(x.reshape([-1, 1]) - x.reshape([1, -2])) + np.abs(y.reshape([-1, 1]) - y.reshape([1, -2]))

print(dist.max())

### FIXED CODE ###

import numpy as np
N = int(input())

x = []
y = []
xy1 = []
xy2 = []

for i in range(N):
    a, b = (int(t) for t in input().split())
    x.append(a)
    y.append(b)
    xy1.append(a + b)
    xy2.append(a - b)

max1 = max(xy1) - min(xy1)
max2 = max(xy2) - min(xy2)
print(max((max1, max2)))
A, B, C=list(map(int, input().split(" "))
if [A, B, C].count(5)==2 and [A, B, C].count(7)==1:
  print('Yes')
else:
  print('No'))

### FIXED CODE ###

A, B, C=list(map(int, input().split(" ")))
if ([A, B, C].count(5)==2) and ([A, B, C].count(7)==1):
  print('YES')
else:
  print('NO')
# coding: utf-8
a,b = map(int, input().split())
count=[0]*a
for i in range(b):
    n = int(input())
    num_list = list(map(int, input().split())) 
    for j in num_list:
       count[j-1]+=1
c=0

for i in range(b):
    if count[i]==0:
        c+=1
print(c)

### FIXED CODE ###

# coding: utf-8
a,b = map(int, input().split())
count=[0]*a
for i in range(b):
    n = int(input())
    num_list = list(map(int, input().split())) 
    for j in num_list:
       count[j-1]+=1
c=0

for i in range(a):
    if count[i]==0:
        c+=1
print(c)
x,y,z,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a = sorted(a)
b = sorted(b)
c = sorted(c)
memory = []
ai = x-1
bi = y-1
ci = z-1
p = 10**5
while k>0:
    ps = []
    abc = []
    for dx in range(-5,5):
        for dy in range(-5,5):
            for dz in range(-5,5):
                if not (ai+dx>=0 and ai+dx<x and bi+dy>=0 and bi+dy<y and ci+dz>=0 and ci+dz<z):
                    continue
                tmp = a[ai+dx]+b[bi+dy]+c[ci+dz]
                if p >= tmp and not (ai+dx,bi+dy,ci+dz) in memory:
                    ps.append(tmp) 
                    abc.append((ai+dx, bi+dy, ci+dz))
    p = max(ps)
    i = ps.index(p)
    memory.append(abc[i])
    print(p)
    k -= 1


### FIXED CODE ###

def main():
    X, Y, Z, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)

    T = []
    for a in A:
        for b in B:
            T.append(a + b)

    T = sorted(T, reverse=True)[:min(K, len(T))]

    res = []
    for t in T:
        for c in C:
            res.append(t + c)

    res = sorted(res, reverse=True)[:K]
    for r in res:
        print(r)

if __name__ == "__main__":
    main()
a,b=[x for x in input().split()]
if a>=13:
    print(b)
elif 6<=a<=12:
    print(b/2)
else:
    print(0)

### FIXED CODE ###

a,b=[int(x) for x in input().split()]
if a>=13:
    print(b)
elif 6<=a<=12:
    print(int(b/2))
else:
    print(0)
def dis(p1,p2):
  return ((p1[0]-p2[0])**2+(p1[1]-p2[0])**2)**0.5

n=int(input())
p=[list(map(int,input().split())) for i in range(n)]
ans=0
fac=1
for i in range(n):
  if(i!=0):
    fac*=i
  for j in range(i+1,n):
    ans+=dis(p[i],p[j])
print(ans*(2n-2)/(fac*n))


### FIXED CODE ###

def dis(p1,p2):
  return ((p1[0]-p2[0])**2+(p1[1]-p2[1])**2)**0.5

n=int(input())
p=[list(map(int,input().split())) for i in range(n)]
ans=0
for i in range(n):
  for j in range(i+1,n):
    ans+=dis(p[i],p[j])
print(ans*2/n)
import math 
r=input()
print "%.9f"%(math.pi*r*r, math.pi*r*2)

### FIXED CODE ###

import math 
r=input()
print "%.9f"%(math.pi*r*r), math.pi*r*2
S = input()

if len(S) <= 2:
    print(0)

else:
    ans1 = 0
    ans2 = 0
    flag1 = 0
    flag2 = 1
    for i in S:
        if flag1 % 2 == int(i):
            pass
        else:
            ans1 += 1
        flag1 += 1
    for i in S:
        if flag2 % 2 == int(i):
            pass
        else:
            ans2 += 1
        flag2 += 1

print(min(ans1,ans2))

### FIXED CODE ###

S = input()

if len(S) <= 2:
    print(0)

else:
    ans1 = 0
    ans2 = 0
    flag1 = 0
    flag2 = 1
    for i in S:
        if flag1 % 2 == int(i):
            pass
        else:
            ans1 += 1
        flag1 += 1
    for i in S:
        if flag2 % 2 == int(i):
            pass
        else:
            ans2 += 1
        flag2 += 1

    print(min(ans1,ans2))
import bisect
import collections

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

index = bisect.bisect_left(x, 0)
if x[index] != 0:
  x.insert(index, 0)
  N += 1
  K += 1

start_min = max(index-K+1, 0)
start_max = min(index, N-K)
min_time = 10**9
for i in range(start_min, start_max+1):
  min_time = min(min_time, x[i+K-1]-x[i]+min(abs(x[i+K-1]), abs(x[i])))
print(min_time)

### FIXED CODE ###

import bisect

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

index = bisect.bisect_left(x, 0)
if index < len(x):
  if x[index] != 0:
    x.insert(index, 0)
    N += 1
    K += 1
else:
  x.insert(index, 0)
  N += 1
  K += 1
  index -= 1

start_min = max(index-K+1, 0)
start_max = min(index, N-K)
min_time = 10**9
for i in range(start_min, start_max+1):
  min_time = min(min_time, x[i+K-1]-x[i]+min(abs(x[i+K-1]), abs(x[i])))
print(min_time)
k = int(input())
s = input()

if len(s) <= k:
    print(s)
else:
    print(s[:k+1]+'...')

### FIXED CODE ###

n = input()

hon = ['2','4','5','7','9']
pon = ['0','1','6','8']
bon = ['3']

if n[-1] in bon:
    print('bon')
elif n[-1] in hon:
    print('hon')
elif n[-1] in pon:
    print('pon')
def solve():
    n = int(input())
    a = []
    b = []
    for _ in range(n):
        A, B = map(int, input().split())
        if B != 1:
            a.append(A)
            b.append(B)

    dis = b[-1] - a[-1]%b[-1]
    ans = [dis]
    for i in range(1, len(a)):
        c = a[-(i+1)]+ans[i-1]
        if c >= b[-(i+1)]:
            dis = b[-(i+1)]-c%b[-(i+1)]
            ans.append(ans[i-1]+dis)
        else:
            dis = c
            ans.append(dis)

    return ans[-1]
    

print(solve())


### FIXED CODE ###

def solve():
    n = int(input())
    a = []
    b = []
    for _ in range(n):
        A, B = map(int, input().split())
        a.append(A)
        b.append(B)

    ans = b[-1] - a[-1]%b[-1]
    if a[-1]%b[-1] == 0: ans = 0

    for i in range(1, n):
        c = a[-(i+1)]+ans
        if c%b[-(i+1)] == 0: continue
        
        if c > b[-(i+1)]:
            dis = b[-(i+1)]-c%b[-(i+1)]
            ans += dis
        else:
            dis = b[-(i+1)] - c
            ans += dis

    return max(0, ans)
    

print(solve())
from itertools import*;from fractions import*;u=accumulate;g=gcd;n,a=open(0);*a,=map(int,a.split());a=[0]+a+[0];print(max(starmap(g,zip(u(a,g),list(u(a[:1:-1],g))[::-1]))))

### FIXED CODE ###

from collections import*
from functools import*
from fractions import*
def dv(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    # divisors.sort()
    return Counter(divisors)

n,*a=map(int,open(0).read().split())
if n<1000:
    ans=Counter()
    for i in range(n):
        ans+=dv(a[i])
    l=[]
    for k,v in ans.items():
        if v==n-1 or v==n:
            l.append(k)
    print(max(l))
else:
    print(max(reduce(gcd,a[n//4:]),reduce(gcd,a[:n//4]+a[n//2:]),reduce(gcd,a[:n//2]+a[3*n//4:]),reduce(gcd,a[:3*n//4])))
n = int(input())
x = input()
original_pop_count = x.count('1')
one_pop_count = original_pop_count-1
zero_pop_count = original_pop_count+1

one_mod = 0
zero_mod= 0
for b in x:
    one_mod=(one_mod*2+int(b))%one_pop_count
    zero_mod=(zero_mod*2+int(b))%zero_pop_count
#予めf[i]を計算する
f = [0]*220000
pop_count = [0]*220000
for i in range(1,220000):
    pop_count[i]= pop_count[i//2] + i%2
    f[i] = f[i%pop_count[i]]+1
one_pow2 = [1]*220000
zero_pow2 = [1]*220000
for i in range(1,220000):
    one_pow2[i] = one_pow2[i-1]*2%one_pop_count
    zero_pow2[i] = zero_pow2[i-1]*2%zero_pop_count


for i in range(n-1,-1,-1):
    if x[n-1-i]=='1':
        nxt = one_mod
        nxt-=one_pow2[i]
        nxt%=one_pop_count
        print(f[nxt]+1)
    if x[n-1-i]=='0':
        nxt = zero_mod
        nxt+=zero_pow2[i]
        nxt%=zero_pop_count
        print(f[nxt]+1)

### FIXED CODE ###

n = int(input())
x = input()
original_pop_count = x.count('1')
one_pop_count = original_pop_count-1
zero_pop_count = original_pop_count+1

one_mod = 0
zero_mod= 0
for b in x:
    if one_pop_count!=0:
        one_mod=(one_mod*2+int(b))%one_pop_count
    zero_mod=(zero_mod*2+int(b))%zero_pop_count
#予めf[i]を計算する
f = [0]*220000
pop_count = [0]*220000
for i in range(1,220000):
    pop_count[i]= pop_count[i//2] + i%2
    f[i] = f[i%pop_count[i]]+1
one_pow2 = [1]*220000
zero_pow2 = [1]*220000
for i in range(1,220000):
    if one_pop_count!=0:
        one_pow2[i] = one_pow2[i-1]*2%one_pop_count
    zero_pow2[i] = zero_pow2[i-1]*2%zero_pop_count


for i in range(n-1,-1,-1):
    if x[n-1-i]=='1':
        if one_pop_count!=0:
            nxt = one_mod
            nxt-=one_pow2[i]
            nxt%=one_pop_count
            print(f[nxt]+1)
        else:
            print(0)
    if x[n-1-i]=='0':
        nxt = zero_mod
        nxt+=zero_pow2[i]
        nxt%=zero_pop_count
        print(f[nxt]+1)
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


N = input()
A = input().split()
for i in range(len(A)):
    A[i] = int(A[i]) 
print("{}".format(gcd_list(A)))

### FIXED CODE ###

from functools import reduce

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def gcd_list(numbers):
    return reduce(gcd, numbers)


N = input()
A = input().split()
for i in range(len(A)):
    A[i] = int(A[i])
answer = gcd_list(A)
print("{}".format(answer))
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


from bisect import bisect_left as bl, bisect_right as br
n,q = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
def sub(x, i):
    # i番目を取れるかどうか
    v = a[i]
    if v<x:
        return False
    target = x - (v-x)
    num = i - bl(a, target-0.1)
    return num+1 >= n - i

anss = [None] * q
for j in range(q):
    x = int(input())
    l = bl(a, x)
    r = n-1
    if sub(x, l):
        r = l
    while l<r-1:
        m = (r+l)//2
        if sub(x, m):
            r = m
        else:
            l = m
    # rまではxより大きくて取れる
#     print("r",  r)
    ans = sum(a[r:])
    ii = r-2 - (n-r-1)
    while ii>=0:
        ans += a[ii]
        ii -= 2
    anss[j] = ans
write("\n".join(map(str, anss)))

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


from bisect import bisect_left as bl, bisect_right as br
n,q = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

def sub(x, i):
    # i番目を取れるかどうか
    v = a[i]
    target = x - (v-x)
    num = i - bl(a, target-0.1)
    return num+1 >= n - i

anss = [None] * q
cumsum1 = [0] * n
cumsum0 = [0] * n
cumsum = [0] * n
for i in range(n):
    if i%2:
        cumsum1[i] = cumsum1[i-1] + a[i]
        cumsum0[i] = cumsum0[i-1]
    else:
        cumsum0[i] = cumsum0[i-1] + a[i]
        cumsum1[i] = cumsum1[i-1]
    cumsum[i] = cumsum[i-1] + a[i]

for j in range(q):
    x = int(input())
    l = 0
    r = n-1
    while l<r-1:
        m = (r+l)//2
        if sub(x, m):
            r = m
        else:
            l = m
    # rまではxより大きくて取れる
#     ans = sum(a[r:])
    ans = cumsum[-1] - cumsum[r-1]
    ii = r-2 - (n-r-1)
    if ii>=0:
        if ii%2:
            ans += cumsum1[ii]
        else:
            ans += cumsum0[ii]
    anss[j] = ans
write("\n".join(map(str, anss)))
N = int(input())
A = list(map(int, input().split()))
ans = [0]*(max(A)+1)

for i in A:
  ans[i-1] += 1
  ans[i] += 1
  ans[i+1] += 1

  
print(max(ans))



### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = [0]*(100000+2)

for i in A:
  ans[i-1] += 1
  ans[i] += 1
  ans[i+1] += 1

  
print(max(ans))
import bisect
import numpy as np
INF=10**18
A,B,Q=map(int,input().split())
s=[int(input()) for i in range(A)]
t=[int(input()) for i in range(B)]
s=[-INF]+s+[INF]
t=[-INF]+t+[INF]
s=np.array(s)
t=np.array(t)
for q in range(G):
    X=int(input())
    t1=bisect.bisect_right(t,X)
    l1=X-t[t1]
    if (t[t1]-X)>(X-t[t1-1]):
        l1=X-t[t1-1]
    s1=bisect.bisect_right(s,X)
    l2=X-s[s1]
    if (s[s1]-X)>(X-s[s1-1]):
        l2=X-s[s1-1]
    l3=bisect.bisect_right(s,X-l1)
    l4=bisect.bisect_right(t,X-l2)
    print(min(abs(l1)+min(s[l3]-X+l1,X-l1-s[l3-1]),abs(l2)+min(t[l4]-X+l2,X-l2-t[l4-1])))



### FIXED CODE ###

import bisect
INF=10**18
A,B,Q=map(int,input().split())
s=[int(input()) for i in range(A)]
t=[int(input()) for i in range(B)]
s=[-INF]+s+[INF]
t=[-INF]+t+[INF]
for q in range(Q):
    X=int(input())
    t1=bisect.bisect_right(t,X)
    s1=bisect.bisect_right(s,X)
    res=INF
    for T in [t[t1],t[t1-1]]:
        for S in [s[s1],s[s1-1]]:
            ans1=abs(X-T)+abs(S-T)
            ans2=abs(X-S)+abs(S-T)
            res=min(res,ans1,ans2)
    print(res)
N=int(input())
A=list(map(int,input().split()))
sum=0
for i in range(1,n):
    if x[i]<x[i-1]:
        t=x[i-1]-x[i]
        sum+=t
        x[i]=x[i-1]

print(sum)


### FIXED CODE ###

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

sum=0
MaxNum=0
for i in range(N):
    MaxNum=max(MaxNum,A[i])
    B=MaxNum
    sum+=MaxNum-A[i]
    
print(sum)
from collections import defaultdict


N, M = map(int, input().split())
parent = [-1] * N


def union(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    parent[x] = y


def find(x):
    if parent[x] == -1:
        return x
    res = parent[x] = find(parent[x])
    return res

for _ in range(M):
    a, b = map(int, input().split())
    union(a - 1, b - 1)


count = defaultdict(int)
for i in range(N):
    count[find(i)] += 1
print(max(count.values()))

### FIXED CODE ###

from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)


N, M = map(int, input().split())
parent = [-1] * N


def union(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    parent[x] = y


def find(x):
    if parent[x] == -1:
        return x
    res = parent[x] = find(parent[x])
    return res

for _ in range(M):
    a, b = map(int, input().split())
    union(a - 1, b - 1)


count = Counter(find(i) for i in range(N))
print(count.most_common(1)[0][1])
count = 0
n = input()
dic = []

for i in range(n):
  com, str = map(str, raw_input().split())
  if com == 'insert':
    dic[count] = str
    count += 1
  elif com == 'find':
    for j in range(count-1):
      if dic[j] == str:
        print 'yes'
        break
      elif j == count-1:
        print 'no'
        break

### FIXED CODE ###

n = input()
dic = set()
 
for i in range(n):
  com, st = map(str, raw_input().split())
  if com == 'insert':
    dic.add(st)
  elif com == 'find':
    if st in dic:
      print 'yes'
    else:
      print 'no'
N,K=map(int,input().split())
sushi=[]
for i in range(N):
    t,d=map(int,input().split())
    sushi.append((t,d))
sushi.sort(key=lambda x:(x[0],-x[1]))
#print(sushi)
X=[sushi[0][1]]
Y=[]
for i in range(1,N):
    if sushi[i-1][0]==sushi[i][0]:
        Y.append(sushi[i][1])
    else:
        X.append(sushi[i][1])
X.sort(reverse=True)
Y.sort(reverse=True)
SX=[0]
SY=[0]
for i in X:
    SX.append(SX[-1]+i)
for i in Y:
    SY.append(SY[-1]+i)
ans=0
#print(X)
#print(Y)
#1<=x<len(X)
#K-len(Y)<=x<=
for x in range(K-len(Y),min(len(SX),K+1)):
    ans=max(SX[x]+SY[K-x]+x*x,ans)
print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
t=[0 for i in range(N)]
d=[0 for i in range(N)]
for i in range(N):
    t[i],d[i]=map(int,input().split())
D=dict()
for i in range(N):
    if not(t[i] in D):
        D[t[i]]=[]
    D[t[i]].append((d[i],i))
E=[0 for i in range(N)]
for key in D:
    D[key].sort(reverse=True)
    E[D[key][0][1]]=1
A=[]
B=[]
for i in range(N):
    if E[i]==1:
        A.append(d[i])
    else:
        B.append(d[i])
A.sort(reverse=True)
B.sort(reverse=True)
X=len(A)
Y=len(B)
S=[0 for i in range(X+1)]
T=[0 for i in range(Y+1)]
for i in range(X):
    S[i+1]=A[i]+S[i]
for i in range(Y):
    T[i+1]=B[i]+T[i]
L=[]
for i in range(1,K+1):
    if i<=X and K-i<=Y:
        L.append(S[i]+T[K-i]+i*i)
print(max(L))
K, S = map(int, input().split())

result = 0

for x in range(K + 1):
    for y in range(K + 1):
        Z = S - X - Y
        if 0 <= Z <= K:
            result += 1

print(result)

### FIXED CODE ###

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

result = 0

for x in range(K + 1):
    for y in range(K + 1):
        z = S - x - y
        if 0 <= z <= K:
            result += 1

print(result)
import itertools
n,m,x=map(in,input().split())
l=[list(map(int,input().split())) for i in range(n)]
costl=[]
for p in itertools.product([0,1],n):
  al=[0]*m
  cost=0
  for i in range(n):
    if p[i]==1:
      cost+=l[i][0]
      for j in range(1,m):
        al[j-1]+=l[i][j]
  if all(mm>=x for mm in m):
    costl.append(cost)
print(min(cost))
      
        
      

### FIXED CODE ###

import itertools
n,m,x=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
sum=[0]*m
for i in range(n):
  for j in range(1,m+1):
    sum[j-1]+=l[i][j]
for ss in sum:
  if ss<x:
    print(-1)
    exit()
list=[]
for p in itertools.product([1,0],repeat=n):
  cnt=[0]*m
  ans=0
  for i in range(n):
    if p[i]==1:
      ans+=l[i][0]
      for j in range(1,m+1):
        cnt[j-1]+=l[i][j]
  if all(cc>=x for cc in cnt):
    list.append(ans)
print(min(list))
i = list(map(int, input().split()))

print(str(np.sort(i)[0]) * np.sort(i)[1])



### FIXED CODE ###

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

print(str(sorted(i)[0]) * sorted(i)[1])
N,K,C=map(int,input().split())
S=list(input())
#print(S)
F=[]
cnt=C
num=1
for i in range(N):
    if cnt>=C and S[i]=="o":
        F.append([num,i])
        num+=1
        cnt=0
    else:
        F.append([F[-1][0],F[-1][1]])
        cnt+=1
#print(F)
E=[]
RS=S[::-1]
cnt=C
num=1
for i in range(N):
    if cnt>=C and S[N-i-1]=="o":
        E.append([num,N-1-i])
        num+=1
        cnt=0
    else:
        E.append([E[-1][0],E[-1][1]])
        cnt+=1
E=E[::-1]
#print(E)
ans=[]
for i in range(N):
    if i==0:
        if E[i+1][0]<K:
            ans.append(1)
    elif i==N-1:
        if F[i-1][0]<K:
            ans.append(N)
    else:
        cnt=F[i-1][0]+E[i+1][0]
        if E[i+1][1]-F[i-1][1]<C:
            cnt-=1
        if cnt<K:
            ans.append(i+1)
#print(ans)
for i in range(len(ans)):
    print(ans[i])

### FIXED CODE ###

N,K,C = map(int,input().split())
S = list(input())
F = []
maru = 0
last = -10**9
span = C
for i in range(N):
    if S[i]=="o" and span >= C:
        maru += 1
        last = i
        F.append([maru,last])
        span = 0
    else:
        span += 1
        F.append([maru,last])
#print(F)
s = S[::-1]
maru = 0
last = 10**9
span = C
E = []
for i in range(N):
    if s[i] == "o" and span >= C:
        maru += 1
        last = N-1-i
        E.append([maru,last])
        span = 0
    else:
        E.append([maru,last])
        span += 1
E = E[::-1]
#print(E)
F = [[0,-10**9]] + F + [[0,10**9]]
E = [[0,-10**9]] + E + [[0,10**9]]
#print(F)
#print(E)
ans = []
for i in range(1,N+1):
    cnt = F[i-1][0] + E[i+1][0]
    
    if S[i-1] == "o":
        if E[i+1][1] - F[i-1][1] < C:
            cnt -= 1
        if cnt == K-1:
            ans.append(i)
    #print(F[i-1],E[i+1],cnt)
for i in range(len(ans)):
    print(ans[i])
N,X=map(int, input().split())
L=list(map(int, input().split()))
s=[x for x in range(N) if sum(L[:x])<=X]
if N>=len(s):
  print(len(s))
else:
  print(N+1)

### FIXED CODE ###

X,A=map(int, input().split())
print(0 if X<A else 10)
n, x, y = map(int, input().split())
ans = [0] * (n-1)
for i in range(1, n+1):
    for j in range(1, n+1):
        if i < j
            # iとjを固定、rangeでi<jを表現
            d = min(j-i, abs(x-i)+abs(j-y)+1, abs(y-i)+abs(x-j)+1)
            # 長さを示すところに+１
            ans[d-1] += 1
print(*ans, sep="\n")

### FIXED CODE ###

n, x, y = map(int, input().split())
ans = [0] * (n-1)
for i in range(1, n):
    for j in range(i+1, n+1):
        # iとjを固定、rangeでi<jを表現
        d = min(j-i, abs(x-i)+abs(j-y)+1, abs(y-i)+abs(x-j)+1)
        # 長さを示すところに+１
        ans[d-1] += 1
print(*ans, sep="\n")
(n,l)=map(int, input().split())
list1=input().split()
list1.sort()
for i in range(n):
	print(list1[i],end="")

### FIXED CODE ###

(n,l)=map(int, input().split())
list1=[]
for i in range(n):
	list1.extend(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")
"""a = int(input())

import itertools
a_list = [i for i in range(3,a+1)]
#print(a_list)

for i in itertools.combinations_with_replacement(a_list,len(a_list)):
    if(sum(i) == a):
        print(sum(i))
        """

MOD = 10**9 + 7
S = int(input())

dp = [1] * 2001
dp[0] = dp[1] = dp[2] = 0
"""
for i in range(S+1):
    for j in range(3, i):
        dp[i] += dp[i-j]
    print(i,dp[0:S+1])

"""

for i in range(3,S+1):
    for l in range(i+1-3):
        dp[i] += dp[l]

    print(i,dp[0:i+1])

      

print(dp[S] % MOD)



### FIXED CODE ###


"""a = int(input())

import itertools
a_list = [i for i in range(3,a+1)]
#print(a_list)

for i in itertools.combinations_with_replacement(a_list,len(a_list)):
    if(sum(i) == a):
        print(sum(i))
        """

MOD = 10**9 + 7
S = int(input())

dp = [1] * 2001
dp[0] = dp[1] = dp[2] = 0
"""
for i in range(S+1):
    for j in range(3, i):
        dp[i] += dp[i-j]
    print(i,dp[0:S+1])

"""

for i in range(3,S+1):
    for l in range(i+1-3):
        dp[i] += dp[l]

    #print(i,dp[0:i+1])

      

print(dp[S] % MOD)
a,b,c,d,e = int(input())
lists = ['a', 'b', 'c', 'd', 'e']
for i in range(lists(4)):
    if i == 0:
        print(i)

### FIXED CODE ###

a=list(map(int,input().split()))
print(a.index(0)+1)
n,a,b = map(int,input().split())
s = 'b'*a + 'r'*b
d = n//(a+b)
q = n % (a+b)

if q <= a:
  print(b*d)
else:
  print(b*d+q-a)



### FIXED CODE ###

n,a,b = map(int,input().split())

if a+b == 0:
  print(0)
  
else:  

  d = n//(a+b)
  q = n % (a+b)

  
  if q <= a:
    print(a*d+q)
  else:
    print(a*d+a)