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

import math
a,b,n=map(int,input().split())
max=-2
if b<n:
    n=b
for i in range(1,n+1):
    if i<b:
        s=math.floor(a*i/b)
    else:
        s=math.floor(a*((1/b)-i//b))
    if s>max:
        max=s
print(max)


### FIXED CODE ###

import math
a,b,n=map(int,input().split())
max=-2
if n<b:
    max=math.floor(a*n/b)
else:
    #b<=n
    max=math.floor(a*(b-1)/b)
    

print(max)
### BUGGY CODE ###

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

L = S.replace('01', '0,1')
L = L.replace('10', '1,0')
L = L.split(',')
L = [len(l) for l in L]

if S[0] == '0':
    L = [0] + L

R = []
for i in range(max(1, len(L) // 2 + 1 - K)):
    R.append(sum(L[2*i:2*(i+K)+1]))

print(max(R))


### FIXED CODE ###

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

L = S.replace('01', '0,1')
L = L.replace('10', '1,0')
L = L.split(',')
L = [len(l) for l in L]

if S[0] == '0':
    L = [0] + L

R = []
for i in range(max(1, len(L) // 2 + 1 - K)):
    if i == 0:
        R.append(sum(L[2*i:2*(i+K)+1]))
    else:
        R.append(R[-1] - sum(L[2*(i-1):2*(i-1)+2]) + sum(L[2*(i+K)-1:2*(i+K)+1]))

print(max(R))
### BUGGY CODE ###

n=int(input())

for a in range(1,n**2+1):
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        
        #print(a,b,len(sa),len(sb))
        if len(sb)-len(sa)==0:
            ans=len(sb)
            break
        elif len(sb)-len(sa)>=1:
             ans=len(sb)
        else:
            #print(b,sb,len(sa),len(sb))
            break

print(ans)

### FIXED CODE ###

n=int(input())

for a in range(1,int(n**0.5+1)):
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        if a<=b:
             ans=len(sb)
        else:
            break

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

# 全部使え オールオアナッシングや

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


def rec(i, money, stock):
    if i == n:
        return money
    # 有り金全部株に変える
    ret2 = 0
    if money > 0:
        p = money // a[i]
        ret2 = rec(i + 1, money - p * a[i], stock + p)
    # 有り株全部金に変える
    ret3 = 0
    if stock > 0:
        ret3 = rec(i + 1, money + stock * a[i], 0)
    return max(money, ret2, ret3)


print(rec(0, 1000, 0))

### FIXED CODE ###

# まず底をみつけてそのあと山で売るを繰り返す
n = int(input())
arr = list(map(int, input().split()))
arr2 = []
cur = arr[0] if arr[0] < arr[1] else 10**10
f = 1
for i in range(1, n):
    if f == 1:
        # print("底値を求める")
        if cur < arr[i]:
            arr2.append(cur)
            f *= -1
    else:
        # print("天井を求める")
        if cur > arr[i]:
            arr2.append(cur)
            f *= -1
    cur = arr[i]
if f == -1:
    arr2.append(cur)
ans = 1000
stock = 0
for i, a in enumerate(arr2):
    if i % 2 == 0:
        # 買いまくる
        stock = ans // a
        ans %= a
    else:
        # うりまくる
        ans += stock * a
        stock = 0
print(ans)
### BUGGY CODE ###

n, q = [int(i) for i in input().split()]
st = input() + '-'
table = []
for i, v in enumerate(st):
	if st[i: i+2] == 'AC':
		table.append(1)
	else:
		table.append(0)

for j in range(q):
	l, r = [int(k) for k in input().split()]
	tmp = table[l-1: r-1]
	print (sum(tmp))

### FIXED CODE ###

n, q = [int(i) for i in input().split()]
st = input() + '-'
table = []
cnt = 0
for i, v in enumerate(st):
	if st[i: i+2] == 'AC':
		cnt += 1
	table.append(cnt)
table = [0] + table

for j in range(q):
	l, r = list(map(int, input().split()))
	print (table[r-1] - table[l-1])
### BUGGY CODE ###

def resolve():
    n = int(input())
    A = [int(input()) for i in range(n)]
    for a in A:
        A_a = A.copy()
        A_a.remove(a)
        print(max(A_a))
resolve()

### FIXED CODE ###

def resolve():
    n = int(input())
    A = [int(input()) for i in range(n)]
    B = sorted(A)
    mx = B[-1]
    second = B[-2]
    for a in A:
        if a == mx:
            print(second)
        else:
            print(mx)
resolve()
### BUGGY CODE ###

from scipy.special import comb

n=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(0,n-1):
    s=0
    for j in range(i+1,n):
        s+=A[j]
    s%=10**9+7
    ans+=(A[i]*s)
    
print(ans%(10**9+7))

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
s=0
ans=0
mod=10**9+7

for i in range(n):
    s+=A[i]

for i in range(0,n-1):
    s-=A[i]
    s%=mod
    ans+=(A[i]*s)
    ans%=mod
print(ans%(10**9+7))
### BUGGY CODE ###

n=int(input())
a=list(map(int, input().split()))
total=0
b=[0]*n
a_cycle=a*2

for i in range(n):
  total+=a[i]
for i in range(n):
  a_tot=0
  for j in range(n//2):
  	a_tot+=a_cycle[i+2*j+1]
  b[i]=total-2*a_tot
print(*b)

### FIXED CODE ###

n=int(input())
a=list(map(int, input().split()))
total=0
b=[0]*n
a_cycle=a*2

for i in range(n):
  total+=a[i]
a_tot=0
for j in range(n//2):
  a_tot+=a_cycle[2*j+1]
b[0]=total-2*a_tot
for i in range(1,n):
  b[i]=2*a[i-1]-b[i-1]
print(*b)
### BUGGY CODE ###

import bisect
N=int(input())
S=list(input())
ans=0
R=[]
G=[]
B=[]
for i in range(N):
    if S[i]=="R":
        R.append(i+1)
    elif S[i]=="G":
        G.append(i+1)
    else:
        B.append(i+1)
B.append(10000)
lenb=len(B)-1
for r in R:
    for g in G:
        flag=0
        left=min(r,g)-abs(r-g)
        right=max(r,g)+abs(r-g)
        if (r+g)%2==0:
            middle=(r+g)//2
        else:
            middle=0
        for i in (left,right,middle):
            if i>0:
                a=bisect.bisect_left(B,i)
                if B[a]==i:
                    flag=flag+1
        ans=ans+lenb-flag
print(ans)

### FIXED CODE ###

N=int(input())
S=list(input())
ans=0
R=0
G=0
B=0
for i in range(N):
    if S[i]=="R":
        R=R+1
    elif S[i]=="G":
        G=G+1
    else:
        B=B+1
ans=R*G*B
for i in range(N-2):
    for j in range(i+1,N-1):
        if S[i]!=S[j]:
            k=2*j-i
            if N<=k:
                continue
            if S[i]!=S[k] and S[k]!=S[j]:
                ans=ans-1
print(ans)
### BUGGY CODE ###

inputs = input().split(' ')
a = int(inputs[0])
b = int(inputs[1])
n = int(inputs[2])

output = 0
ab = a*b
for x in range(1, n + 1):
    if x % ab == 0:
        break
    buf = (a*x//b) - a*(x//b)
    if buf > output:
        output = buf

print(output)

### FIXED CODE ###

inputs = input().split(' ')
a = int(inputs[0])
b = int(inputs[1])
n = int(inputs[2]) + 1

x = (n if n < b else b) - 1
output = (a*x//b)

print(output)
### BUGGY CODE ###

# -*- coding: utf-8 -*-


def main():
    s = input()
    q = int(input())

    for i in range(q):
        qi = input().split()

        if qi[0] == '1':
            s = s[::-1]
        else:
            if qi[1] == '1':
                s = qi[2] + s
            else:
                s += qi[2]

    print(s)


if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-


def main():
    from collections import deque

    s = input()
    q = int(input())
    d = deque()
    d.append(s)
    reverse_count = 0

    for i in range(q):
        qi = input().split()

        if qi[0] == '1':
            reverse_count += 1
        else:
            if reverse_count % 2 == 0:
                if qi[1] == '1':
                    d.appendleft(qi[2])
                else:
                    d.append(qi[2])

            else:
                if qi[1] == '1':
                    d.append(qi[2])
                else:
                    d.appendleft(qi[2])

    c = ''.join(map(str, d))

    if reverse_count % 2 == 1:
        c = c[::-1]

    print(c)


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

N,K = (int(i) for i in input().split())  
h = [int(input()) for i in range(N)]

h.sort()

ans=[]

for i in range(N):
	if i+K==N+1:
		break
	else:
		ans.append(max(h[i:i+K]) - min(h[i:i+K]))
print(min(ans))


### FIXED CODE ###

N,K = (int(i) for i in input().split())  
h = [int(input()) for i in range(N)]
 
h.sort()
 
ans=[]
 
for i in range(N):
	if i+K==N+1:
		break
	else:
		ans.append(h[i+K-1] - h[i])
print(min(ans))
### BUGGY CODE ###

N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
hp = Q - K
for i in range(N):
    if A.count(i+1) > hp:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
correct = [0] * N

for a in A:
    correct[a-1] += 1

hp = Q - K
for i in range(N):
    if correct[i] > hp:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

n, k = map(int, input().split())

l = [i for i in range(n+1)]
r = list(reversed(l))

cnt = 0

for i in range(k, n+2):
  min = sum(l[:i])
  max = sum(r[:i])

  if min == max:
    cnt += 1
  else:
    cnt += max - min + 1

print(cnt)


### FIXED CODE ###

n, k = map(int, input().split())
cnt = 0
mod = 10**9+7

for i in range(k, n+2):
  min = int(i * (i - 1) / 2) #等差数列の和
  max = int(i * (2 * n - i + 1) / 2)
  cnt += max - min + 1

print(cnt % mod)
### BUGGY CODE ###


N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
for i in range(N):
    cnt = 0
    for j in range(N):
        if A[i] % A[j] == 0:
            cnt += 1
            if A[j] > A[i]:
                break
    if cnt == 1:
        ans += 1
print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
visited=[False for i in range(10**6+1)]
ban=[False for i in range(10**6+1)]
from collections import Counter
A.sort()
D=dict(Counter(A))
for n in A:
    if visited[n]==False:
        visited[n]=True
        for j in range(2,10**6):
            if 10**6<n*j:
                break 
            ban[n*j]=True
ans=0
for n in A:
    if D[n]==1 and ban[n]==False:
        ans+=1
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

S = input().rstrip("\n")

# dp[i][j]: i文字目でjになる個数 (S[-i])
# 1-indexed
dp = [[0]*13 for _ in range(len(S)+1)]

# 初期条件(1桁目)
if S[-1] == "?":
    dp[1][:10] = [1]*10
else:
    dp[1][int(S[-1])] += 1

# i: i桁目
for i in range(1,len(S)+1):
    if S[-i] == "?":
        # j: S[-i]がとる値 (?のとき0~9)
        for j in range(10):
            jmod = j*(10**(i-1)) % 13
            # (i-1)桁目で余りがkとなる個数x
            for k,x in enumerate(dp[i-1]):
                dp[i][(k+jmod)%13] += x
    else:
        jmod = int(S[-i])*(10**(i-1)) % 13
        for k,x in enumerate(dp[i-1]):
            dp[i][(k+jmod)%13] += x

print(dp[-1][5] % (10**9+7))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10**9+7

S = input().rstrip("\n")

# dp[i][j]: i文字目でjになる個数 (S[-i])
# 1-indexed
dp = [[0]*13 for _ in range(len(S)+1)]

# 初期条件(1桁目)
if S[-1] == "?":
    dp[1][:10] = [1]*10
else:
    dp[1][int(S[-1])] += 1

# mul = 10**(i-1)
mul = 10
# i: i桁目
for i in range(2,len(S)+1):
    if S[-i] == "?":
        # j: S[-i]がとる値 (?のとき0~9)
        for j in range(10):
            jmod = j*mul % 13
            # (i-1)桁目で余りがkとなる個数x
            for k,x in enumerate(dp[i-1]):
                dp[i][(k+jmod)%13] = (dp[i][(k+jmod)%13] + x) % MOD
    else:
        jmod = int(S[-i])*mul % 13
        for k,x in enumerate(dp[i-1]):
            dp[i][(k+jmod)%13] = (dp[i][(k+jmod)%13] + x) % MOD
    mul = (mul * 10) % 13

print(dp[-1][5])
### BUGGY CODE ###

import sys

n, m = [int(x) for x in sys.stdin.readline().split()]

s = []
d = []

for i in range(m):
	a, b = [int(x) for x in sys.stdin.readline().split()]
	if a == 1:
		if b not in s:
			if b in d:
				print('POSSIBLE')
				break
			else:
				s.append(b)
	if b == n:
		if a not in d:
			if a in s:
				print('POSSIBLE')
				break
			else:
				d.append(a)
else:
	print('IMPOSSIBLE')

### FIXED CODE ###

n, m = [int(x) for x in input().split()]

s = [0]*(n+1)
d = [0]*(n+1)

for i in range(m):
	a, b = [int(x) for x in input().split()]
	if a == 1:
		s[b] = 1
		if d[b] == 1:
			print('POSSIBLE')
			break
	elif b == n:
		d[a] = 1
		if s[a] == 1:
			print('POSSIBLE')
			break
else:
	print('IMPOSSIBLE')
### BUGGY CODE ###


N, V = list(map(int, input().split()))
C = list(map(int, input().split()))
assert len(C)==N

W = [1 for i in range(N)]
F = [0 for i in range(V+1)]

def pack01(F, c, w):
    """
    f: states
    c: cost
    w: value

    v: volume
    """
    for v in range(c, V+1)[::-1]:
        F[v] = max(F[v], F[v-c]+w)
for i in range(N):
    pack01(F, C[i], W[i])

s = sum(C)
if s==V or s>V:
    print(F[-1])
elif sum(C)<V:
    print(F[-1]-1)
    

### FIXED CODE ###

N, V = list(map(int, input().split()))
C = list(map(int, input().split()))
N = len(C)

if sum(C)==V:
  print(N)
else:
  cnt = 0
  for c in sorted(C):
    if V-c>0:
      cnt += 1
      V -= c
    elif V-c==0:
      cnt += 1
      break
    else:
      break
  print(min(cnt, N-1))
### BUGGY CODE ###

import math

r, g, b, n = map(int, input().split())
ball = [0, r, g, b]
count = 0

for i in range(n+1):
    for j in range(n+1):
        m = math.floor((n-i*r-j*g)/b)
        if i*r+j*g+m*b == n and m >= 0:
            count += 1
            
print(count)

### FIXED CODE ###

r, g, b, n = map(int, input().split())
ball = [0, r, g, b]
dp = [[0] * 4 for _ in range(n+1)]
dp[0][0] = 1

for i in range(n+1):
    for k in range(4):
        if k == 0:
            if i != 0:
                dp[i][k] = 0
        else:
            if i - ball[k] < 0:
                dp[i][k] = dp[i][k-1]
            else:
                dp[i][k] = dp[i-ball[k]][k] + dp[i][k-1]

print(dp[n][3])
### BUGGY CODE ###

n = int(input())
s = []
for _ in range(n):
    #s.append(list(input())) # !!!
    #s.append(sorted(list(input()))) # !!!
    #s.append(sorted(input())) # !!!
        s.append(''.join(sorted(input())))
    #''.join(sorted((sorted(input()))
#print(s)

x = 0
for i in range(n):
    for j in range(i+1, n):
        if s[i] == s[j]:
            x += 1
 
print(x)

### FIXED CODE ###

n = int(input())
s = []
for _ in range(n):
    #s.append(list(input())) # !!!
    #s.append(sorted(list(input()))) # !!!
    #s.append(sorted(input())) # !!!
    s += [''.join(sorted(input()))]
    #''.join(sorted((sorted(input()))
s = sorted(s)
s.append('X')
#print(s)

a = []
x = 1
for i in range(1,n+1):
    if s[i] == s[i-1]:
        x += 1
    else:
        a.append(x)
        x = 1
#print(a)
y = 0

for j in a:
    y += j*(j-1)/2

print(int(y))
### BUGGY CODE ###

from fractions import gcd

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

#https://qiita.com/maebaru/items/317af98e85e9f4db04f9
def prime_numbers(m):
    # 素数を保持するset
    primes = set()

    # 2以上m以下の素数を数え上げる
    n = 2
    while n <= m:
        # 自身より小さい全ての素数で割り切れなければ、素数とみなせる
        if all(n % i != 0 for i in primes):
            primes.add(n)
        n += 1

    return list(primes)
    
#https://qiita.com/snow67675476/items/e87ddb9285e27ea555f8
def factorization(n,primes,primenum_count_for_lcm):
    temp = n
    for i in range(len(primes)):
        if temp%primes[i]==0:
            cnt=0
            while temp%primes[i]==0:
                cnt+=1
                temp //= primes[i]
            if primenum_count_for_lcm[i] < cnt:
                primenum_count_for_lcm[i] = cnt
        if temp < primes[i]:
            break

    if temp!=1:
        if 10**3<temp:
            primes.append(temp)
            primenum_count_for_lcm.append(1)
        else:    
            idx = primenum_count_for_lcm.index(temp)
            if primenum_count_for_lcm[idx] == 0:
                primenum_count_for_lcm[idx] = 1
            
    #if arr==[]:
    #    arr.append([n, 1])
    
    return primenum_count_for_lcm

primes = prime_numbers(int(10**6))
primes.sort()
primenum_count_for_lcm = [0]*len(primes)
for i in range(N):
    primenum_count_for_lcm = factorization(A[i],primes,primenum_count_for_lcm)

sugoilcm = 1
for i in range(len(primes)):
    sugoilcm *= primes[i]**primenum_count_for_lcm[i]

ans = 0
for i in range(N):
    ans += sugoilcm//A[i]
print(int(ans%(10**9+7)))


### FIXED CODE ###

import fractions

def main():
    mod = 10**9+7
    N = int(input())
    A = list(map(int,input().split()))
    lcm = 1
    for Ai in A:
        lcm = lcm*Ai//fractions.gcd(lcm,Ai)
    lcm %= mod
    ans = 0
    for Ai in A:
        ans += lcm*pow(Ai,mod-2,mod)%mod
        ans %= mod
    print(ans)
    
if __name__ == '__main__':
    main()
### BUGGY CODE ###

from collections import Counter

n, p = map(int, input().split())
s = input().rstrip()

total = 0
if p in [2, 5]:
    for i in range(n-1, -1, -1):
        if int(s[i]) % p == 0:
            total += i + 1
else:
    dp = [0] * (n + 1)
    fac = 1
    for i in range(n-1, -1, -1):
        dp[i] = (dp[i + 1] + int(s[i]) * fac) % p
        fac *= 10

    c = Counter(dp)

    for k, v in c.items():
        if v >= 2:
            total += v * (v - 1) // 2

print(total)


### FIXED CODE ###

from collections import Counter

n, p = map(int, input().split())
s = input().rstrip()

total = 0
if p in [2, 5]:
    for i in range(n-1, -1, -1):
        if int(s[i]) % p == 0:
            total += i + 1
else:
    dp = [0] * (n + 1)
    fac = 1
    for i in range(n-1, -1, -1):
        dp[i] = (dp[i + 1] + int(s[i]) * fac) % p
        fac = (fac * 10) % p

    c = Counter(dp)

    for k, v in c.items():
        if v >= 2:
            total += v * (v - 1) // 2

print(total)
### BUGGY CODE ###

def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0


for i in range(N-K+1):
  if sum(p[i:i+K])>t:
    t=sum(p[i:i+K])
    
print((K+t)/2)
  
      
if __name__ == '__main__':
    main()      
    
      

### FIXED CODE ###

def main():
    """"ここに今までのコード"""
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
p=list(map(int,input().split()))
t=0
k=sum(p[0:K])

if N==K:
  print((k+K)/2)
else:
  for i in range(N-K):
    k-=p[i]
    k+=p[i+K]
    if k>t:
      t=k
    
  print((K+t)/2)

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

n=int(input())
a=[]
for i in range(1,n):
  a.append(i)
c=0
for i in a:
    c=c+(i%n)
print(c)

### FIXED CODE ###

n=int(input())
n-=1
a=(n*(n+1))//2
print(a)
### BUGGY CODE ###

import math
from functools import reduce


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


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


n = int(input())

result = 0
for i in range(n):
    for j in range(n):
        for k in range(n):
            result += gcd(i+1, j+1, k+1)

print(result)


### FIXED CODE ###

from math import gcd

k = int(input())
ans = 0

for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            ans += gcd(gcd(i, j), k)

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

# -*- coding: utf-8 -*-

"""
参考：https://img.atcoder.jp/abc082/editorial.pdf
・DPをxとyの2つに分けて行う。
　[step][x] = その時xはその状態になれるか
　[step][y] = その時yはその状態になれるか
・x方向とy方向は独立に考えることができる。
"""

from collections import defaultdict

S = input()
X, Y = map(int, input().split())

S2 = []
tmp = 0
# 連続するF毎にまとまるように文字列Sを変形させる
for i in range(len(S)):
    if S[i] == 'F':
        tmp += 1
    # T毎に区切る
    else:
        S2.append(tmp)
        tmp = 0
S2.append(tmp)

# 文字列がFのみだとこの後のDPできないので別処理
if len(S2) == 1:
    if X == S2[0] and Y == 0:
        print('Yes')
    else:
        print('No')
    exit()

# dictならマイナスの添字もそのまま使える
dpx = [defaultdict(int) for _ in range(len(S2))]
dpy = [defaultdict(int) for _ in range(len(S2))]
# xの初期化：step0は右移動、step1ではそのまま
dpx[0][S2[0]] = dpx[1][S2[0]] = 1
# yの初期化：step0は何もなし、step1で上下どちらかに移動
dpy[1][S2[1]] = dpy[1][-S2[1]] = 1
for i in range(2, len(S2)):
    for j in range(-len(S), len(S)+1):
        # 左右に移動する
        if i % 2 == 0:
            # 前回stepに今回step分を+-して到達可能か見る
            dpx[i][j] = dpx[i-1][j-S2[i]] | dpx[i-1][j+S2[i]]
            # xをやる時はyはそのまま
            dpy[i][j] = dpy[i-1][j]
        # 上下に移動する
        else:
            dpx[i][j] = dpx[i-1][j]
            dpy[i][j] = dpy[i-1][j-S2[i]] | dpy[i-1][j+S2[i]]
# 最後のstepでXとYが到達可能ならOK
if dpx[len(S2)-1][X] and dpy[len(S2)-1][Y]:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

# -*- coding: utf-8 -*-

"""
参考：https://img.atcoder.jp/abc082/editorial.pdf
　　　https://atcoder.jp/contests/abc082/submissions/3930644
・メモリ節約のため、dictをsetにした。
・さらに使い終わった1つ前はもういらないので消すことにした。
"""

S = input()
X, Y = map(int, input().split())

S2 = []
tmp = 0
# 連続するF毎にまとまるように文字列Sを変形させる
for i in range(len(S)):
    if S[i] == 'F':
        tmp += 1
    # T毎に区切る
    else:
        S2.append(tmp)
        tmp = 0
S2.append(tmp)

# 文字列がFのみだとこの後のDPできないので別処理
if len(S2) == 1:
    if X == S2[0] and Y == 0:
        print('Yes')
    else:
        print('No')
    exit()

# あるかないか分かればいいので、dictじゃなくてsetにする
dpx = [set() for _ in range(len(S2))]
dpy = [set() for _ in range(len(S2))]
# xの初期化：step0は右移動、step1ではそのまま
dpx[0].add(S2[0])
dpx[1].add(S2[0])
# yの初期化：step0は何もなし、step1で上下どちらかに移動
dpy[0].add(0)
dpy[1].add(S2[1])
dpy[1].add(-S2[1])
for i in range(2, len(S2)):
    # 左右に移動する
    for v in dpx[i-1]:
        if i % 2 == 0:
            # 到達可能な位置から+-した位置に送る
            dpx[i].add(v-S2[i])
            dpx[i].add(v+S2[i])
        else:
            # yをやる時はxはそのまま
            dpx[i].add(v)
    # 1つ前は使い終わったので削除
    dpx[i-1] = set()
    # 上下に移動する
    for v in dpy[i-1]:
        if i % 2 == 1:
            dpy[i].add(v-S2[i])
            dpy[i].add(v+S2[i])
        else:
            dpy[i].add(v)
    dpy[i-1] = set()
# 最後のstepでXとYが到達可能ならOK
if X in dpx[len(S2)-1] and Y in dpy[len(S2)-1]:
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

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 CODE ###

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 CODE ###

import itertools
import math
import fractions
import functools
k = int(input())
h_list = []


for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            h_list.append([i,j,l])

sum = 0
for i in range(len(h_list)):
    a = fractions.gcd(h_list[i][0], h_list[i][1])
    sum += fractions.gcd(a,h_list[i][2])

print(sum)

### FIXED CODE ###

import itertools
import math
import fractions
import functools

K = int(input())
 
res = 0
for i in range(1, K+1):
  for j in range(1, K+1):
    gcd1 = math.gcd(i, j)
    for k in range(1, K+1):
      if gcd1 == 1:
        res += 1
      else:
        res += math.gcd(gcd1, k)
print(res)