Harryxun/stf_run huggingface dataset:
import sys
import math
import numpy as np
import copy

def dfs(now, group, groups, edges):
    if groups[now] != -1:
        return 0
    groups[now] = group
    cnt = 1
    for to in edges[now]:
        cnt += dfs(to, group, groups, edges)
    return cnt

def main():
    n, m, k = map(int, input().split())
    edges = [list() for i in range(n)]
    ngs = [list() for i in range(n)]
    for i in range(m):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        edges[a].append(b)
        edges[b].append(a)
    for i in range(k):
        c, d = map(int, input().split())
        c, d = c-1, d-1
        ngs[c].append(d)
        ngs[d].append(c)


    cnt = 0
    groups = [-1 for i in range(n)]
    nodes_cnt = list()

    ans = [0 for i in range(n)]
    
    for i in range(n):
        if groups[i] == -1:
            nodes_cnt.append(dfs(i, cnt, groups, edges))
            cnt += 1
        ans[i] = nodes_cnt[groups[i]] - len(edges[i]) - 1
        for ng in ngs[i]:
            if groups[i] == groups[ng]:
                ans[i] -= 1

    print(*ans, sep=" ")


if __name__ == '__main__':
    sys.exit(main())

### FIXED CODE ###

import sys
import math
import numpy as np
import copy

def dfs(now, group, groups, edges):
    if groups[now] != -1:
        return 0
    groups[now] = group
    cnt = 1
    for to in edges[now]:
        cnt += dfs(to, group, groups, edges)
    return cnt

def main():
    n, m, k = map(int, input().split())
    edges = [list() for i in range(n)]
    ngs = [list() for i in range(n)]
    for i in range(m):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        edges[a].append(b)
        edges[b].append(a)
    for i in range(k):
        c, d = map(int, input().split())
        c, d = c-1, d-1
        ngs[c].append(d)
        ngs[d].append(c)


    cnt = 0
    groups = [-1 for i in range(n)]
    nodes_cnt = list()

    ans = [0 for i in range(n)]
    
    for i in range(n):
        if groups[i] == -1:
            nodes_cnt.append(dfs(i, cnt, groups, edges))
            cnt += 1
        ans[i] = nodes_cnt[groups[i]] - len(edges[i]) - 1
        for ng in ngs[i]:
            if groups[i] == groups[ng]:
                ans[i] -= 1

    print(*ans, sep=" ")

if __name__ == '__main__':
    sys.setrecursionlimit(1000000)
    sys.exit(main())
#-*- coding:utf-8 -*-

n, k, q = map(int, input().split())
a_li = [int(input()) for i in range(q)]

pt_li = [] #所持点数のリストを作る
for i in range(n):
    pt_li.append(k)

for t in range(q):
    for u in range(n):
        pt_li[u] -= 1
    pt_li[a_li[t]-1] += 1

print(pt_li)

for s in range(n):
     if pt_li[s] <= 0:
         print("No")
     else:
         print("Yes")


### FIXED CODE ###

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

S = input()

if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
from collections import defaultdict
from operator import sub

def main():
    N = int(input())
    balls = [tuple(map(int,input().split())) for _ in range(N)]
    d = defaultdict(int)
    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            d[tuple(map(sub, balls[i], balls[j]))] += 1
    mmax = max(d.values())
    try:
        mmax = int(N - mmax)
        print(mmax)
    except:
        print(100)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict
from operator import sub

def main():
    N = int(input())
    balls = [tuple(map(int,input().split())) for _ in range(N)]
    d = defaultdict(int)
    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            d[tuple(map(sub, balls[i], balls[j]))] += 1
    try:
        mmax = N - max(d.values(), default=0)
        print(mmax)
    except ValueError:
        print(100)

if __name__ == '__main__':
    main()
n, m = map(int,input().split())
d = {i: {chr(i): 0 for i in range(ord('a'), ord('z')+1)} for i in range(n)}
d2 = {i: {chr(i): 0 for i in range(ord('a'), ord('z')+1)} for i in range(m)}
for i in range(n):
    s = input()
    for j in s:
        d[i][j] += 1
    for j in range(len(s)):
        d2[j][s[j]] += 1

k = [0 for i in range(n)]
k2 = [0 for i in range(m)]

f = True
for i in range(n):
    for j in range(n):
        if d[i] == d[j]:
            k[i] += 1


for i in range(m):
    for j in range(m):
        if d2[i] == d2[j]:
            k2[i] += 1

k2 = sorted(k2)
k = sorted(k)
if n % 2:
    if len(k) > 1:
        if k[1] < 2:
            f = False
else:
    if k[0] < 2:
        f = False

if m % 2:
    if len(k) > 1:
        if k2[1] < 2:
            f = False
else:
    if k2[0] < 2:
        f = False

if f:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

n = int(input())
l0 = list(map(int, input().split()))
l = sorted(l0)

m1 = l[n//2 - 1]
m2 = l[n//2]
for i in range(len(l0)):
    if l0[i] < m2:
        print(m2)
    elif l0[i] > m1:
        print(m1)
    elif l0[i] == m1:
        print(m2)
    elif l0[i] == m2:
        print(m1)
N, M, K =  [int(x) for x in input().split()]

stackA = [int(x) for x in input().split()]
stackB = [int(x) for x in input().split()]

books = 0

while True:
    if len(stackB) == 0:
        if len(stackA) == 0:
            break

        K -= stackA.pop(0)

    elif len(stackA) == 0:
        K -= stackB.pop(0)

    else:
        test = 0
        while stackA[test] == stackB[test]:
            test += 1
          
        if stackA[test] > stackB[test]:
            K -= stackB.pop(0)

        else:
            K -= stackA.pop(0)        

    if K < 0:
        break
        
    books += 1

print(books)

### FIXED CODE ###

N, M, K =  [int(x) for x in input().split()]

stackA = [int(x) for x in input().split()]
stackB = [int(x) for x in input().split()]

indexB = 0
indexA = 0

books = 0
mostBooks = 0
time = 0

for x in stackB:
    if time + x > K:
        break

    else:
        time += x
        indexB += 1
        books += 1

indexB -= 1

mostBooks = books

for x in stackA:
    time += x
    books += 1

    while time > K and indexB >= 0:
        time -= stackB[indexB]
        indexB -= 1
        books -= 1

    if indexB < 0 and time > K:
        break

    mostBooks = max(mostBooks, books)

print(mostBooks)
import numpy as np
a = int(input())
b = np.array(list(map(int, input().split())))
b = np.prod(b)
if b > 10**18:
    print('-1')
else:print(c)


### FIXED CODE ###

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

if 0 in a:
    print(0)
    exit()

mult = 1

for i in a:
    mult *= i
    if mult > 10**18:
        print(-1)
        exit()
print(mult)
N,L=map(int,input().split())
s = N*L+sum(1,N+1)-N
K=[]
for i in range(1,N+1):  
    K.append(L+i-1)
if 0 <= K[0]:
    s -= K[0]
elif K[0]<0 and K[N-1]>0:
    s = s
else:
    s -= K[N-1]
print(s)

### FIXED CODE ###

N,L=map(int,input().split())
s = N*L
for i in range (N+1):
    s += i
s -= N
K=[]
for i in range(1,N+1):  
    K.append(L+i-1)
if 0 <= K[0]:
    s -= K[0]
elif K[0]<0 and K[N-1]>0:
    s = s
else:
    s -= K[N-1]
print(s)
import math
a,b,x = map(float,input().split())

c = a/(2*b-2*x/a**2)
d = (2*x)/(a*b**2)
if x/a >= a*b/2:
  result = math.atan(c)
else:
  result = math.degrees(math.atan(d))
print(result)

### FIXED CODE ###

import math
a,b,x = map(float,input().split())

c = (2*b-(2*x)/(a*a))/a
d = (a*b*b)/(2*x)
if x/a >= a*b/2:
  result = math.degrees(math.atan(c))
else:
  result = math.degrees(math.atan(d))
print(result)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

AB = [(a, i, 0) for i, a in enumerate(A)] + [(b, i, 1) for i, b in enumerate(B)]
AB.sort()

X = AB[:N]
Y = AB[N:]

if any(x[0] == y[0] for x, y in zip(X, Y)):
    print('No')
    exit()
print('No')

1 / 0

ans = [-1] * N

for (x, i, sx), (y, j, sy) in zip(X, Y):
    if sx == sy:
        if A[i] == B[i] or A[j] == B[j]:
            ans[i] = B[j]
            ans[j] = B[i]
        else:
            ans[i] = B[i]
            ans[j] = B[j]
    else:
        if sx == 1:
            i, j = j, i
        ans[i] = B[j]

assert not ans.count(-1), 'undefined'

print('Yes')
print(*ans)


### FIXED CODE ###

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

AB = [(a, i, 0) for i, a in enumerate(A)] + [(b, i, 1) for i, b in enumerate(B)]
AB.sort()

X = AB[:N]
Y = AB[N:]

if any(x[0] == y[0] for x, y in zip(X, Y)):
    print('No')
    exit()

swapA = []
swapB = []
ans = [-1] * N

for (_, i, sx), (_, j, sy) in zip(X, Y):
    if sx == sy == 0:
        swapA.append((i, j))
    elif sx == sy == 1:
        swapB.append((i, j))
    else:
        if sx == 0:
            ans[i] = B[j]
        else:
            ans[j] = B[i]

for (i, j), (x, y) in zip(swapA, swapB):
    ans[i] = B[x]
    ans[j] = B[y]

    if A[i] == ans[i] or A[j] == ans[j]:
        ans[i], ans[j] = ans[j], ans[i]

print('Yes')
print(*ans)
atcoder = input()
ACGT = list('ACGT')

s = ''
sub_list = []
for i, l in enumerate(list(atcoder)):
    if l in ACGT:
        s += l
        if i == len(atcoder)-1:
            sub_list.append(len(s))
    else:
        if s != '':
            sub_list.append(len(s))
        s = ''
print(max(sub_list))


### FIXED CODE ###

atcoder = input()
ACGT = list('ACGT')

s = ''
sub_list = []
for i, l in enumerate(list(atcoder)):
    if l in ACGT:
        s += l
        if i == len(atcoder)-1:
            sub_list.append(len(s))
    else:
        sub_list.append(len(s))
        s = ''
print(max(sub_list))
import sympy

a, b, c = list(map(Decimal, input().split(" ")))

print("Yes" if (sympy.sqrt(a) + sympy.sqrt(b)) < sympy.sqrt(c) else "No")


### FIXED CODE ###

a, b, c = map(int, input().split(" "))

if c - a - b > 0 and 4 * a * b < (c - a - b)**2:
    print("Yes")
else:
    print("No")
N, K = map(int, input().split())
import math

ttl = 0
l = []
for i in range(K):
  a = math.factorial(i+2+N-K)/((math.factorial(N-K+1))*(math.factorial(i+1)))
  b = math.factorial(K-1+i)/((math.factorial(K-1))*(math.factorial(i)))
  ans = a*b
  l.append(ans)

for j in l:
  print(int(j%(10^9+7)))


### FIXED CODE ###

N, K = map(int, input().split())
import math
mod =10**9+7

l = []
l.append(N-K+1)
for i in range(1, K):
  a = l[i-1] * (N-K-i+1) * (K-i) // ((i+1)*i)
  l.append(int(a))

for j in l:
  print(j%mod)
x,a = map(int,input().split())
print(min(10,(x//a)*10))

### FIXED CODE ###

x,a = map(int,input().split())
print(0) if x<a else print(10)
n = int(input())
hoge = [int(input()) for i in range(n)]

for i in range(len(hoge)):
    temp = hoge.copy()
    del temp[i]
    print(pd.array(temp).max())

### FIXED CODE ###

n = int(input())
hoge = [int(input()) for i in range(n)]
max_value = max(hoge)
second_value = sorted(hoge)[-2]
if max_value == second_value:
    for i in range(len(hoge)):
        print(max_value)
else:
    for i in hoge:
        if i != max_value:
            print(max_value)
        else:
            print(second_value)
while True:
    n = input()
    if n == 0:
        break
    dic = {}
    for _ in xrange(n):
        name, cost = raw_input().split()
        dic[name] = int(cost)
    m = input()
    recipe = []
    for _ in xrange(m):
        data = raw_input().split()
        recipe.append([data[0]]+data[2:])
    for _ in xrange(m):
        for i in xrange(m):
            dic[recipe[i][0]] = min(recipe[i][0], 
                                    sum(map(lambda x:dic[x], recipe[i][1:])))
    print dic[raw_input()]

### FIXED CODE ###

INF = 1 << 29
while True:
    n = input()
    if n == 0:
        break
    dic = {}
    for _ in xrange(n):
        name, cost = raw_input().split()
        dic[name] = int(cost)
    m = input()
    recipe = []
    for _ in xrange(m):
        data = raw_input().split()
        if data[1] <= 0:
            m -= 1
            continue
        recipe.append([data[0]]+data[2:])
    for _ in xrange(m):
        for i in xrange(m):
            dic[recipe[i][0]] = min(dic[recipe[i][0]] if recipe[i][0] in dic else INF, 
                                    sum(map(lambda x:dic[x] if x in dic else INF, recipe[i][1:])))
    print dic[raw_input()]
Row = int(input())
flag = True
List = []
for i in range (Row):
  List.append(int(input()))
s_l = set(List)
if len(List) != len(s_l):
  print("No")
for i in range(Row-1):
  n = len(List[i])-1
  if List[i][n] != List[i+1][0]:
    flag = False
if flag:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

Row = int(input())
flag = True
List = []
for i in range (Row):
  List.append(input())
s_l = set(List)
if len(List) != len(s_l):
  print("No")
else:
  for i in range(Row-1):
    n = len(List[i])-1
    if List[i][n] != List[i+1][0]:
      flag = False
  if flag:
    print("Yes")
  else:
    print("No")
import math
from decimal import *
A,B=input().strip().split()
C=Decimal(A)
D=Decimal(B)
result=math.floor(A*B)
print(result)

### FIXED CODE ###

from decimal import Decimal
import math
a,b = map(Decimal,input().split())
ans = a*b
print(math.floor(ans))
N, X=map(int, input().split())
A=[int(input(for _ in range(N)))]
rest=X-sum(A)
print(rest//min(A)+N)

### FIXED CODE ###

N, X=map(int, input().split())
A=[int(input()) for _ in range(N)]
rest=X-sum(A)
print(rest//min(A)+N)
if input().isupper == true:
  print("A")
else:
  print("a")

### FIXED CODE ###

if input().isupper():
  print("A")
else:
  print("a")
sen=raw_input()
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
g=[]
h=[]
i=[]
j=[]
k=[]
l=[]
m=[]
n=[]
o=[]
p=[]
q=[]
r=[]
s=[]
t=[]
u=[]
v=[]
x=[]
y=[]
z=[]
w=[]
count={'a':a,'b':b,'c':c,'d':d,'e':e,'f':f,'g':g,'h':h,'i':i,'j':j,'k':k,'l':l,'m':m,'n':n,'o':o,'p':p,'q':q,'r':r,'s':s,'t':t,'u':u,'v':v,'w':w,'x':x,'y':y,'z':z}
for i in range(len(sen)):
    if sen[i].isalpha():
        count[sen[i].lower()].append('#')
for char in [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]:
    print('%s:%d'%(char,len(count[char])))

### FIXED CODE ###

import sys
sen=[]
for line in sys.stdin:
    sen.append(line)
Sen=''.join(sen)

a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
g=[]
h=[]
i=[]
j=[]
k=[]
l=[]
m=[]
n=[]
o=[]
p=[]
q=[]
r=[]
s=[]
t=[]
u=[]
v=[]
x=[]
y=[]
z=[]
w=[]
count={'a':a,'b':b,'c':c,'d':d,'e':e,'f':f,'g':g,'h':h,'i':i,'j':j,'k':k,'l':l,'m':m,'n':n,'o':o,'p':p,'q':q,'r':r,'s':s,'t':t,'u':u,'v':v,'w':w,'x':x,'y':y,'z':z}
for i in range(len(Sen)):
    if Sen[i].isalpha():
        count[Sen[i].lower()].append('#')
for char in sorted(count.keys()):
    print('%s : %d'%(char,len(count[char])))
import math
from functools import reduce

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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

l = lcm_list(a)
count = 0
for i in range(len(a)):
    count += int(l/a[i])
    count = count % (1000000007)
print(count)

### FIXED CODE ###

from fractions import gcd
 
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
for i in a:
    l = i * l // (gcd(i, l))
 
cnt = 0
for i in a:
    cnt += l // i
print(cnt % mod)
import math
A,B,H,M = map(int,input().split())

a=[A*math.cos(math.radians(30*H+0.5*M),A*math.sin(math.radians(30*H+0.5*M))]
b=[B*math.cos(math.radians(M*60)),B*math.sin(math.radians(M*60))]
#print(a,b)
dir = ((a[0]-b[0])**2 + (a[1]-b[1])**2)**0.5
print(dir)


### FIXED CODE ###

import math
A,B,H,M = map(int,input().split())
dega = (60*H+M)*(360/(60*12))
degb = M*(360/60)
a = [A*math.cos(math.radians(dega)),A*math.sin(math.radians(dega))]
b = [B*math.cos(math.radians(degb)),B*math.sin(math.radians(degb))]
dir = ((a[0]-b[0])**2 + (a[1]-b[1])**2)**0.5
print(dir)
"""
author : dokueki
"""
s = input()
t = "abcdefghijklmnopqrstuvwxyza"
for i in range(len(t)):
    if t[i] == a:
        print(t[i+1])
        break
        

### FIXED CODE ###

"""
author : dokueki
"""
s = input()
t = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(t)):
    if t[i] == s:
        print(t[i+1])
        break
S = str(input())

if "a" in S and "b" in S and "c" in S:
  	print("Yes")
else ;
	print("No")

### FIXED CODE ###

S = str(input())

if "a" in S and "b" in S and "c" in S:
  	print("Yes")
else :
	print("No")
N,M = map(int,input().split())
X=[int(i) for i in input().split()]
X.sort()

Y=list()
for i in range(M)[1:]
  Y.append(X[i]-X[i-1])

Y.sort()

if N==1:
  print(sum(Y))
else:
  print(sum(Y[:-(N-1)]))


### FIXED CODE ###

N,M = map(int,input().split())
X=sorted([int(i) for i in input().split()])

Y=list()
for i in range(M)[1:]:
  diff = X[i]-X[i-1]
  Y.append(diff)

Y=sorted(Y)

if N==1:
  print(sum(Y))
else:
  print(sum(Y[:-(N-1)]))
sen = [A,B,C]
sen = sen.sort()
if sen == [5,5,7]:
	print("YES")
else:
	print("NO")


### FIXED CODE ###

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

A, B, C = map(int, (input().split()))

sen = [A, B, C]
x = max(sen)
y = min(sen)
if x == 7 and y == 5 and sum(sen) - x - y == 5:
    print("YES")
else:
    print("NO")
a = [input() for i in range(2)]

text = a[0]
iter = int(a[1])

text_list = list(text)
ren = []
start = text_list[0]
a = 0
for i in range(1,len(text_list)):
  if text_list[i] == start:
    a += 1
    if i == len(text_list)-1:
      ren.append(a)
  else:
    start = text_list[i]
    ren.append(a)
    a = 0

for i in range(len(ren)):
  ren[i] += 1

ans = 0
if text_list[0] == text_list[-1]:
  if ren[0] % 2 == 1 and ren[-1] % 2 == 1:
    for r in ren:
      ans += (r//2)
    ans *= iter
    ans += iter-1
  else:
    for r in ren:
      ans += (r//2)
      ans *= iter    
else:
  for r in ren:
    ans += (r//2)
  ans *= iter

print(ans)
    
  

### FIXED CODE ###

a = [input() for i in range(2)]

text = a[0]
iter = int(a[1])

text_list = list(text)
ren = []
start = text_list[0]
a = 0
for i in range(1,len(text_list)):
  if text_list[i] == start:
    a += 1
    if i == len(text_list)-1:
      ren.append(a)
  else:
    start = text_list[i]
    ren.append(a)
    a = 0

for i in range(len(ren)):
  ren[i] += 1

if ren == []:
  ren = [1]
  
ans = 0
if len(ren) == 1:
  ans = ren[0] * iter // 2
elif text_list[0] == text_list[-1]:
  if ren[0] % 2 == 1 and ren[-1] % 2 == 1:
    for r in ren:
      ans += (r//2)
    ans *= iter
    ans += iter-1
  else:
    for r in ren:
      ans += (r//2)
    ans *= iter    
else:
  for r in ren:
    ans += (r//2)
  ans *= iter

print(ans)
n,k=map(int,input().split())
s=input()

num_cnt=[]
if s[0]=='1':
  num_cnt.append(0)

cnt=1
for i in range(1,n):
  if s[i]==s[i-1]:
    cnt+=1
  else:
    num_cnt.append(cnt)
    cnt=1
num_cnt.append(cnt)

if k<=n/2:
  ans=sum(num_cnt[:2*k])

  tmp=len(num_cnt)
  if tmp%2==0:
    limit=tmp//2-k-1
  else:
    num_cnt.append(0)
    limit=tmp//2-k
  
  #print(ans)
  #print(num_cnt)
  if k/2<=n:
    tmp=num_cnt[2*k]+num_cnt[2*k+1]-num_cnt[0]
    if tmp>0:
      ans+=tmp
  
  for i in range(1,limit):
    tmp=num_cnt[2*(i+k)]+num_cnt[2*(i+k)+1]-num_cnt[2*i]-num_cnt[2*i+1]
    #print(tmp)
    if tmp>0:
      ans+=tmp
else:
  ans=n
print(ans)
  

### FIXED CODE ###

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

num_cnt=[]
if s[0]=='1':
  num_cnt.append(0)

cnt=1
for i in range(1,n):
  if s[i]==s[i-1]:
    cnt+=1
  else:
    num_cnt.append(cnt)
    cnt=1
num_cnt.append(cnt)

leng=len(num_cnt)
if leng/2>k:
  ans=sum(num_cnt[:2*k])
  tot=ans
  
  if leng%2==0:
    limit=leng//2-k
  else:
    num_cnt.append(0)
    limit=leng//2-k+1
  
  #print(ans)
  #print(num_cnt)
  tmp2=num_cnt[2*k]+num_cnt[2*k+1]-num_cnt[0]
  tot+=tmp2
  if tot>ans:
    ans=tot
  
  for i in range(1,limit):
    #print(2*(i+k)+1)
    tmp=num_cnt[2*(i+k)]+num_cnt[2*(i+k)+1]-num_cnt[2*i]-num_cnt[2*i-1]
    #print(tot)
    tot+=tmp
    if tot>ans:
      ans=tot
else:
  ans=n
print(ans)
import string

S = input()

abc = [chr(i) for i in range(97, 97+26)]

if len(S) < 26:
    for s in S:
        abc.remove(s)
    add = abc[0]
    print(S + add)
elif S == ''.join(sorted(abc, reverse=True)):
    print(-1)
else:
    N = len(S)
    for i in range(1, N):
        now = S[N-i]
        fow = S[N-i+1:]
        fows = sorted(list(fow))
        for f in fows:
            if now < f:
                now = f
                break
        if now != S[N-i]:
            ans = S[:N-i] + now
            break
    print(ans)



### FIXED CODE ###

import string

S = input()

abc = [chr(i) for i in range(97, 97+26)]

if len(S) < 26:
    for s in S:
        abc.remove(s)
    add = abc[0]
    print(S + add)
elif S == ''.join(sorted(abc, reverse=True)):
    print(-1)
else:
    N = len(S)
    for i in range(1, N):
        now = S[N-i-1]
        fow = S[N-i:]
        fows = sorted(list(fow))
        for f in fows:
            if now < f:
                now = f
                break
        if now != S[N-i-1]:
            ans = S[:N-i-1] + now
            break
    print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A)
B = A[:][::-1]

fac = [1, 1]
finv = [1, 1]
inv = [0, 1]
Mod = 10**9+7
def COMinit():
  #N_C_kのN
  for i in range(2, 10**5+10):
    fac.append(fac[-1]*i%Mod)
    inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
    finv.append(finv[-1] * inv[-1] % Mod)


def COM(n, k):
  if n < 0 or k < 0 or n < k:
    return 0
  return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod

COMinit()

comb = {}
for i in range(K-1, N):
  comb[(i, K-1)] = COM(i, K-1, p)

ans = 0
for i in range(K-1, N):
  ans += A[i] * comb[(i, K-1)]
  ans %= p 
for i in range(K-1, N):
  ans -= B[i] * comb[(i, K-1)]
  ans %= p
print(ans)



### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A)
B = A[:][::-1]

fac = [1, 1]
finv = [1, 1]
inv = [0, 1]
Mod = 10**9+7
def COMinit():
  #N_C_kのN
  for i in range(2, 10**5+10):
    fac.append(fac[-1]*i%Mod)
    inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
    finv.append(finv[-1] * inv[-1] % Mod)


def COM(n, k):
  if n < 0 or k < 0 or n < k:
    return 0
  return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod

COMinit()

comb = {}
for i in range(K-1, N):
  comb[(i, K-1)] = COM(i, K-1)

ans = 0
for i in range(K-1, N):
  ans += A[i] * comb[(i, K-1)]
  ans %= Mod
for i in range(K-1, N):
  ans -= B[i] * comb[(i, K-1)]
  ans %= Mod
print(ans)
def resolve():
    S = input()
    i = S.index("C")
    s = S[i+1:]
    if "C" in S and "F" in s:
        print("Yes")
    else:
        print("No")
resolve()

### FIXED CODE ###

def resolve():
    S = input()
    c = 0
    f = 0
    C = []
    F = []
    for i in range(len(S)):
        if S[i] == "C":
            c = 1
            C.append(i)
        elif S[i] == "F":
            f = 1
            F.append(i)
    print("Yes" if c == 1 and f == 1 and min(C) < max(F) else "No")
resolve()