Harryxun/stf_run huggingface dataset:
import sys
import math 
from heapq import *
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()
N,K = na()
S = [na() for i in range(N)]
S.sort(key=lambda x:x[1],reverse=True)
res = []
tmp=0
d={}
ans = [0]*N
for i in S[:K]:
    tmp+=i[1]
    if i[0] not in d:
        d[i[0]]=1
    else:
        d[i[0]]+=1
ans[len(d)]=tmp+len(d)**2
for i in S[:K]:
    if d[i[0]]>1:
        res.append([i[1], i[0]])
heapify(res)

for i in range(len(res)):
    dd,t = heappop(res)
    for j in S[K:]:
        if d[t]>1 and (j[0] not in d):
            d[t] -= 1
            d[j[0]] = 1
            heappush(res,[j[1],j[0]])
            ans[len(d)] = ans[len(d)-1]+(j[1]-dd)+(len(d)**2-(len(d)-1)**2)
            break
print(max(ans))

### FIXED CODE ###

import sys
import math 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()
N,K = na()
S = [na() for i in range(N)]
S.sort(key=lambda x:x[1],reverse=True)
res = []
tmp=0
d=set([])
ds = []
for t,dd in S[:K]:
    tmp+=dd
    if t in d:
        ds.append(dd)
    else:
        d.add(t)
ans = tmp + len(d)**2
ax = ans

for t,dd in S[K:]:
    if len(ds)==0:
        break
    if t not in d:
        ax +=2*len(d)+1
        ax += dd-ds.pop()
        d.add(t)
        ans = max(ax,ans)
print(ans)
import sympy
N = int(input())
p = 1
for i in range(1, N+1):
    p *= i
ans = sympy.divisor_count(p)
print(ans % (10**9+7))

### FIXED CODE ###

n = int(input())
ans = 1
r = [1] * (n + 1)
s = n


for i in range(1, n + 1):
    p = i
    while p % 2 == 0:
        p = p // 2
        r[1] += 1

    for j in range(3, i + 1, 2):
        while p % j == 0:
            p = p // j
            r[j-1] += 1

for k in range(n+1):
    ans *= r[k]

ans = ans % (10 ** 9 + 7)
print(ans)
N = int(input())
ans = 0

if(N%2 == 0):
  ans = N/2
else:
  ans = math.floor(N/2) + 1
  
print(ans)


### FIXED CODE ###

N = int(input())
ans = 0

if(N%2 == 0):
  ans = N/2
else:
  ans = N/2 + 0.5
  
ans = int(ans)
print(ans)
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()
ans = X[-1] - X[0]
d = []
for i in range(M-1):
    d.append(X[i+1]-X[i])
d.sort()
n = min(N-1,M-1)
for i in range(n):
    ans -= d[-i]
print(ans)


### FIXED CODE ###

T,X = map(int,input().split())
print(T/X)
n=int(input())
a=sorted(list(map(int,input().split()))[::-1]
print(sum(a[::2])-sum(a[1::2]))

### FIXED CODE ###

n=int(input())
li=map(int,input().split())
li=sorted(li)[::-1]
A=0
B=0
for k in range(n//2):
  A += li[2*k]
  B += li[2*k+1]
if n % 2 ==1:
  A += li[n-1]
print(A-B)
import numpy as np
from heapq import heapreplace, heapify
N=int(input())
A=np.array([int(a) for a in input().split(" ")])
lheap, rheap = list(A[:N]), list(-A[2*N:])
heapify(lheap)
heapify(rheap)
Lsum, Rsum = sum(lheap), sum(rheap)
left = [Lsum]
right = [Rsum]

for i in range(N):
    if A[N+i] > lheap[0]:
        Lsum += (A[N+i]-lheap[0])
        heapreplace(lheap, A[N+i])
    
    if -A[2*N-i-1] > rheap[0]:
        Rsum += (-A[2*N-i-1]-rheap[0])
        heapreplace(rheap, -A[2*N-i-1])
    
    left.append(Lsum)
    right.append(Rsum)
print(max(np.array(left)+np.array(right)[::-1]))

### FIXED CODE ###

import numpy as np
from heapq import heapreplace, heapify
N=int(input())
A=np.array([int(a) for a in input().split(" ")])
lheap, rheap = list(A[:N]), list(-A[2*N:])
heapify(lheap)
heapify(rheap)
Lsum, Rsum = sum(lheap), sum(rheap)
left = [Lsum]
right = [Rsum]

for i in range(N):
    if A[N+i] > lheap[0]:
        Lsum += (A[N+i]-lheap[0])
        heapreplace(lheap, A[N+i])
    
    if -A[2*N-i-1] > rheap[0]:
        Rsum += (-A[2*N-i-1]-rheap[0])
        heapreplace(rheap, -A[2*N-i-1])
    
    left.append(Lsum)
    right.append(Rsum)
print(max(np.array(left)+np.array(right)[::-1]))
input_yen = int(input())
unit_yen = 1000

required_bill = int(float(input_yen)/unit_yen) * unit_yen
return required_bill - input_yen

### FIXED CODE ###

input_yen = int(input())
unit_yen = 1000

required_bill = int(float(input_yen)/unit_yen + (float(input_yen) % unit_yen > 0)) * unit_yen
print(required_bill - input_yen)
import sys

imput = sys.stdin.readline
N,M,L = map(int,input().split())
road = [[float('inf')]*N for i in range(N)]
for i in range(N):
    road[i][i] = 0
for i in range(M):
    a,b,c = map(int,input().split())
    road[a-1][b-1] = c

for i in range(N):
    for j in range(N):
        for k in range(N):
            road[i][j] = min(road[i][j],road[i][k]+road[k][j])
ans = [[float("inf")]*N for i in range(N)]
for i in range(N):
    ans[i][i] = 0
for i in range(N):
    for j in range(N):
        if road[i][j] <= L:
            ans[i][j] = 1
for i in range(N):
    for j in range(N):
        for k in range(N):
            ans[i][j] = min(ans[i][j],ans[i][k]+ans[k][j])
for i in range(int(input()):
    a,b = map(int,input().split())
    o = ans[a-1][b-1]
    if o == float('inf'):
        print(-1)
    else:
        print(o-1)
    


### FIXED CODE ###

import sys
imput = sys.stdin.readline
def func(d):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] = min(d[i][j],d[i][k]+d[k][j])
    return d
N,M,L = map(int,input().split())
road = [[10**10]*N for i in range(N)]
for i in range(N):
    road[i][i] = 0
for i in range(M):
    a,b,c = map(int,input().split())
    road[a-1][b-1] = c
    road[b-1][a-1] = c
road = func(road)
ans = [[10**5]*N for i in range(N)]
for i in range(N):
    for j in range(N):
        if road[i][j] <= L:
            ans[i][j] = 1
ans = func(ans)
for i in range(int(input())):
    a,b = map(int,input().split())
    o = ans[a-1][b-1]
    if o == 10**5:
        print(-1)
    else:
        print(o-1)
n,c,k=map(int,input().split())
lista=[int(input())for i in range(n)]
listb=sorted(lista)
count=0
bustime=0
buspeople=0
for i in listb:
    if buspeople==0 or bustime<i:
        count+=1
        buspeople=c-1
        bustime=i+k
    else :
        buspeople-=1
print(count)

### FIXED CODE ###

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

count=0
zougen=""
for i in range(n-1):
    if zougen=="":
        if lista[i]<lista[i+1]:
            zougen="up"
        if lista[i]>lista[i+1]:
            zougen="down"
    elif  zougen=="up":
        if lista[i]>lista[i+1]:
            count+=1
            zougen=""
    elif zougen=="down":
        if lista[i]<lista[i+1]:
            count+=1
            zougen=""
print(count+1)
h = input()
w = input()
n = input()
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
return x
  


### FIXED CODE ###

h = int(input())
w = int(input())
n = int(input())
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
print(x)
N, M = map(int, input().split())
D = {i: 0 for i in range(1, N + 1)}
for i in range(M):
  a, b = map(int, input().split())
  D[a], D[b] += 1
p = 0
for i in D:
  if i % 2 == 1:
    p = 1
if p == 0:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

N, M = map(int, input().split())
D = {i: 0 for i in range(1, N + 1)}
for i in range(M):
  a, b = map(int, input().split())
  D[a] += 1
  D[b] += 1
p = 0
for i in D:
  if D[i] % 2 == 1:
    p = 1
if p == 0:
  print("YES")
else:
  print("NO")
print(180*(Nint(input())))

### FIXED CODE ###

print(180*(int(input())-2))
n=int(input())
x=[int(input()) for i in range(n)]
 
ans=1
for i in x:
  ans = ans*i
  
if ans > 1000000000000000000:
  ans=-1
print(ans)

### FIXED CODE ###

n=int(input())
x=list(map(int, input().split()))
 
ans=1
if 0 in x:
  ans=0
else:
  for i in x:
    ans=ans*i
    if ans>10**18:
      ans=-1
      break
print(ans)
a = x // 500
b = (x % 500)//5

s = a * 1000 + b * 5

print(s)


### FIXED CODE ###

x = int(input())

a = x // 500
b = (x % 500)//5

s = a * 1000 + b * 5

print(s)
nums = list(input().split())
if sum(nums) == 17:
  print("YES")
else:
  print("NO")
  

### FIXED CODE ###

A, B, C = map(int, input().split())
if A*B*C == 5*5*7:
  print("YES")
else:
  print("NO")
s = input()
l = [None, 'SAT', 'FRY', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(s))

### FIXED CODE ###

s = input()
l = [None, 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(s))
n, k = map(int, input().split())
H = list(map(int, input().split()))
dp = [float("inf") for _ in range(n)]  # 最小化問題なのでinfで初期化
dp[0] = 0  # 初期条件
 
dp[1] = dp[0] + abs(H[1] - H[0])  # 初期条件2
 
for i in range(n - 1):  # 配るDP
    for j in  range(1, min(k+1, n-i)):
        dp[i + j] = min(dp[i + j], dp[i] + abs(H[i + j] - H[i]))
print(dp[n - 1])

### FIXED CODE ###

n = int(input())
H = list(map(int, input().split()))
dp = [float("inf") for _ in range(n)]  # 最小化問題なのでinfで初期化
dp[0] = 0  # 初期条件
dp[1] = dp[0] + abs(H[1]-H[0])  #　初期条件2

for i in range(2, n):
    dp[i] = min(dp[i], dp[i-1] + abs(H[i]-H[i-1]))
    dp[i] = min(dp[i], dp[i-2] + abs(H[i]-H[i-2]))
print(dp[n-1])
Copy
Copy
a  = int(input())
if a == 2:
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())
    print()
elif a == 3:
    a1, a2, a3 = map(int, input().split())
    b1, b2, b3 = map(int, input().split())
    print(1,3)
elif a == 5:
    a1, a2, a3, a4, a5 = map(int, input().split())
    b1, b2, b3, b4, b5 = map(int, input().split())
    print(a1,a2)
    print(a1+1,a2)
    print(a1+2,a2)
    print(a1+3,a2)
    print(a1+4,a2)
elif a == 6:
    a1, a2, a3, a4, a5, a6 = map(int, input().split())
    b1, b2, b3, b4, b5, b6 = map(int, input().split())
    print(2,2)
    print(5,5)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# (a,b,c,d) -> (ab,bc,cd,da) と変換
# xor x で不変量になる

N = int(readline())

A = list(map(int,readline().split()))
B = list(map(int,readline().split()))

def convert(A):
    return [x ^ y for x,y in zip(A,A[1:])] + [A[-1] ^ A[0]]

C = convert(A); D = convert(B)

def Z_algorithm(S):
    # 共通接頭辞の長さを返す
    N=len(S)
    arr = [0]*N
    arr[0] = N
    i,j = 1,0
    while i<N:
        while i+j<N and S[j]==S[i+j]:
            j += 1
        arr[i]=j
        if not j:
            i += 1
            continue
        k = 1
        while i+k<N and k+arr[k]<j:
            arr[i+k] = arr[k]
            k += 1
        i += k; j -= k
    return arr

Z = Z_algorithm(D + [-1] + C + C)[N+1:N+N+1]

K = [i for i,x in enumerate(Z) if x == N]
X = [A[k] ^ B[0] for k in K]

print('\n'.join('{} {}'.format(k,x) for k,x in zip(K,X)))
S=input()
A=0
for i in range(len(S):
               if S[i] != S[len(S)-1]:
               A += 1
print(A)

### FIXED CODE ###

s = list(input())
n = len(s)
res = 0

for i in range(n//2):
    if s[i] != s[n-1-i]:
        res += 1

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

edge = np.zeros((N,N))
color = [-1] * (N)

for i in range(N-1) :
    u , v , w = map(int,input().split())
    edge[u-1,v-1] = w
    edge[v-1,u-1] = w

stack = [(0,0)] # (頂点 , 距離)

while len(stack) > 0 :
    v , d = stack.pop()

    if d % 2 == 0 :
        color[v] = '1'
    else :
        color[v] = '0'

    for u , w in enumerate(edge[v]) :
        if w > 0 and color[u] == -1 :
            stack.append((u,d+w))

for i in color :
    print(i)

### FIXED CODE ###

from collections import deque

N = int(input())

edge = [[] for _ in range(N)]
check = [False] * N
dist = [0] * N

for i in range(N-1) :
    u , v , w = map(int,input().split())
    edge[u-1].append((v-1,w))
    edge[v-1].append((u-1,w))

q = deque([0])

while q :
    current = q.popleft()
    if check[current] :
        continue

    check[current] = True
    for ad , w in edge[current] :
        if not check[ad] :
            q.append(ad)
            dist[ad] = dist[current] + w

for w in dist :
    print(w % 2)
a=input()

b=chr(a)
c=chr(b)
d=chr(c)

print(chr(ord(d)+1))

### FIXED CODE ###

from sys import stdin

def main():
    s = stdin.readline().strip()
    print(chr(ord(s)+1))

main()
def get_difference():
	# get input from raw_input()
	n, k = map(int, raw_input().split(' '))
	l = [int(e) for e in raw_input().split(' ')]
	if k in l:
		print "POSSIBLE"
		return
	if k>max(l):
		print "IMPOSSIBLE"
		return
	gcd_v = reduce(gcd, l)
	if k%gcd_v==0:
		print "POSSIBLE"
	else:
		print "IMPOSSIBLE"


if __name__ == "__main__":
	get_difference()

### FIXED CODE ###

from fractions import gcd
N, K = map(int, raw_input().split(' '))
A = map(int, raw_input().split(' '))
 
M = max(A)
G = reduce(gcd, sorted(A))
 
if not K % G and K <= M:
    print 'POSSIBLE'
else:
    print 'IMPOSSIBLE'
degree = math.pi / 3
 
def print_point(point):
    print "%f %f"
 
def koch(depth, p1, p2):
    if depth == 0:
        return
    s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3)
    t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3)
    u = ((t[0] - s[0]) * math.cos(degree) - (t[1] - s[1]) * math.sin(degree) + s[0],
         (t[0] - s[0]) * math.sin(degree) + (t[1] - s[1]) * math.cos(degree) + s[1])
    depth -= 1
    koch(depth, p1, s)
    print_point(s)
    koch(depth, s, u)
    print_point(u)
    koch(depth, u, t)
    print_point(t)
    koch(depth, t, p2)
 
n = int(raw_input())
start = (0.0, 0.0)
end = (100.0, 0.0)
print_point(start)
koch(n, start, end)
print_point(end)

### FIXED CODE ###

import math
dig_six = math.radians(60)

def koch(d, p1, p2):
    if d == 0:
        return d
    #calc s, u, t from p1, p2
    s_x = (2*p1[0]+1 * p2[0]) / 3
    s_y = (2*p1[1]+1 * p2[1]) / 3
    s = (s_x, s_y)
    t_x = (1*p1[0]+2 * p2[0]) / 3
    t_y = (1*p1[1]+2 * p2[1]) / 3
    t = (t_x, t_y)
    u_x = (t_x - s_x)*math.cos(dig_six) - (t_y - s_y)*math.sin(dig_six) + s_x
    u_y = (t_x - s_x)*math.sin(dig_six) + (t_y - s_y)*math.cos(dig_six) + s_y
    u = (u_x, u_y)
    
    koch(d-1, p1, s)
    print (' '.join([str(x) for x in s]))
    koch(d-1, s, u)
    print (' '.join([str(x) for x in u]))
    koch(d-1, u, t)
    print (' '.join([str(x) for x in t]))
    koch(d-1, t, p2)

if __name__ == '__main__':
    iterate = int(input())
    p1 = (0.0, 0.0)
    p2 = (100.0, 0.0)
    print (' '.join([str(x) for x in p1]))
    koch(iterate, p1, p2)
    print (' '.join([str(x) for x in p2]))
import collections
n = map(int, input().split())
A = list(map(int, input().split()))
q = map(int, input().split())
 
cnt = collections.Counter(A)
ANS = []
base = sum(A)

for i in range(q):
  b,c = map(int, input().split())
  ans = base + (c-b) * cnt[b]
  ANS.append(ans)
  cnt[c] += cnt[b]
  cnt[b] = 0
  base = ans

for i in ANS:
  print(i)

### FIXED CODE ###

import collections

n = int(input())
A = list(map(int, input().split()))
q = int(input())

CNT = collections.Counter(A)
ANS = []
ans = sum(A)

for i in range(q):
    b, c = map(int, input().split())
    t = CNT[b]
    ans +=(c - b) * t
    ANS.append(ans)
    CNT[c] += t
    CNT[b] = 0

for i in ANS:
    print(i)
c=input()
if c='a' or c='i' or c='u' or c='e' or c='o':
  print(vowel)
else:
  print(consonant)

### FIXED CODE ###

c=input()
if c=='a' or c=='i' or c=='u' or c=='e' or c=='o':
  print('vowel')
else:
  print('consonant')
input()
a = [int(i), for i in input().split()]
print(min(a), max(a), sum(a))

### FIXED CODE ###

input()
a = [int(i) for i in input().split()]
print(min(a), max(a), sum(a))
yasumi = 0
syukudai = 1
nissu = list(map(int,input().split()))
syukudaiNissu = list(map(int,input().split()))
if sum(syukudaiNissu) > nissu[yasumi]:
  print(-1)
  exit()
print(nissu[yasumi] - sum(syukudaiNissu))

### FIXED CODE ###

import math
print(int(input())*2*math.pi)
n = int(input())
a = list(map(int, input().split()))
sum = 0
for each in range(1,n):
    for other in range(each):
        sum += (a[each] % (10**9 + 7)) * (a[other] % (10**9 + 7))
        sum = sum % (10**9 + 7)
print(sum)

### FIXED CODE ###

d,t,s = map(int, input().split())
time = d / s
if t >= time:
    print("Yes")
else:
    print("No")
S = str(input())
K = int(input())
for i in range(K):
  if S[i] != "1":
    print(S[i]) 
else:
  print(S[K-1])

### FIXED CODE ###

S = str(input())
K = int(input())
for i in range(K):
  if S[i] != "1":
    print(S[i])
    break
else:
  print(1)
a,b,c,d=map(int,input().split())
print(min(a,b)+min(c,d))

### FIXED CODE ###

x=[int(input()) for _ in range(4)]
print(min(x[0],x[1])+min(x[2],x[3]))
num_list = map(int, raw_input().split())
print ' '.join(map(str, sorted(numlist))

### FIXED CODE ###

num_list = map(int, raw_input().split())
print ' '.join(map(str, sorted(num_list)))
#!/usr/bin/env python3

def main():
    import sys
    def I(): return int(sys.stdin.readline())
    def LI(): return list(map(int,sys.stdin.readline().split()))

    n = I()
    V = []
    W = []
    m = min(n, 1 << 10)
    maxL = 10**5
    dp = [[0]*(maxL + 1)]
    
    for i in range(1, n+1):
        v, w = LI()
        V.append(v)
        W.append(w)
        half = i >> 1
        dp_ = dp[half][:]
        if i <= m:
            for j in range(w, maxL+1)[::-1]:
                if dp_[j] < dp_[j - w] + v:
                    dp_[j] = dp_[j - w] + v
            dp.append(dp_)
    
    q = I()
    for i in range(q):
        v, L = LI()
        if v <= m:
            print(dp[v][L])
        else:
            cnt = 0
            v_ = []
            w_ = []
            while v > m:
                v_.append(V[v-1])
                w_.append(W[v-1])
                v >>= 1
                cnt += 1
            ret = dp[v][L]
            v_tmp = [0] * (1 << cnt)
            w_tmp = [0] * (1 << cnt)
            for b in range(1, 1 << cnt):
                lsb = b & -b
                l = lsb.bit_length()
                w_tmp[b] = w_tmp[b - lsb] + w_[l-1]
                if w_tmp[b] <= L:
                    v_tmp[b] = v_tmp[b - lsb] + v_[l-1]
                    ret = max(ret, v_tmp[b] + dp[v][L - w_tmp[b]])
            print(ret)

if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3

def main():
    import sys
    def I(): return int(sys.stdin.readline())
    def LI(): return list(map(int,sys.stdin.readline().split()))

    n = I()
    V = []
    W = []

    maxL = 10**5
    m = min(n, 1 << 10)
    dp = [[0]*(maxL + 1)]
    
    for i in range(n):
        v, w = LI()
        if i <= m:
            d_ = dp[(i+1)>>1][:]
            for j in range(w, maxL+1)[::-1]:
                d_[j] = max(d_[j], d_[j - w] + v)
            dp.append(d_)
        V.append(v)
        W.append(w)
    
    q = I()
    for i in range(q):
        v, L = LI()
        if v <= m:
            print(dp[v][L])
            continue
        cnt = 0
        v_ = []
        w_ = []
        while v > m:
            v_.append(V[v-1])
            w_.append(W[v-1])
            v >>= 1
            cnt += 1
        ret = dp[v][L]
        v_tmp = [0] * (1 << cnt)
        w_tmp = [0] * (1 << cnt)
        for b in range(1, 1 << cnt):
            lsb = b & -b
            l = lsb.bit_length()
            w_t = w_tmp[b - lsb] + w_[l-1]
            w_tmp[b] = w_t
            if w_t <= L:
                v_t = v_tmp[b - lsb] + v_[l-1]
                v_tmp[b] = v_t
                ret = max(ret, v_t + dp[v][L - w_t])
        print(ret)
    return

if __name__ == "__main__":
    main()
cards = {
         'S':[0 for _ in range(13)],
         'H':[0 for _ in range(13)],
         'C':[0 for _ in range(13)],
         'D':[0 for _ in range(13)],
        }

n = int(input())

for _ in range(n):
    (s, r) = input().split()
    r = int(r)
    cards[s][r - 1] = r

for s in ( 'S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print( '{0:s} {1:d}',format(s, r+1))

### FIXED CODE ###

cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
        }
 
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    r = int(r)
    cards[s][r - 1] = r
 
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print( '{0:s} {1:d}'.format(s, r+1))
val = input()
for i in range(len(val)):
  if val[i] == "C":
  	for n range(i+1, len(val)):
      if val[n] == "F":
      	print("Yes")
      else:
        print("No")
  else:
    print("No")

### FIXED CODE ###

val = input()
count = 0
for i in range(len(val)):
    if val[i] == "C":
        for n in range(i+1, len(val)):
            if val[n] == "F" and count == 0:
                print("Yes")
                count += 1
if count == 0:
    print("No")
import numpy as np
S=input();T=S[::-1];a=[];c=0
for t in T:
    if t==">":
        c+=1
    else:
        c=0
    a.append(c)
A=np.array(a[::-1]+[0])
b=[];c=0
for s in S:
    if s=="<":
        c+=1
    else:
        c=0
    b.append(c)
B=np.array([0]+b)
print(np.maximum(A,B).sum())

### FIXED CODE ###

S=input()
S_rev=S[::-1]

import numpy as np

arr_rev=[]
cnt=0
for s_rev in S_rev:
    if s_rev==">":
        cnt+=1
    else:
        cnt=0
    arr_rev.append(cnt)

A=np.array(arr_rev[::-1]+[0])

arr=[]
cnt=0
for s in S:
    if s=="<":
        cnt+=1
    else:
        cnt=0
    arr.append(cnt)

B=np.array([0]+arr)

print(sum(np.maximum(A,B)))
a=input().split(" ")
list1=[]

for i in range(int(a[0])):
	b=input()
	list1.append(b)

list2=sorted(list1)

for j in range(int(a[0])+1):
	c=c+list2[j]

print(c)
	


### FIXED CODE ###

a=input().split(" ")
list1=[]
c=""


for i in range(int(a[0])):
	b=input()
	list1.append(b)

list2=sorted(list1)

for j in range(int(a[0])):
    c=c+list2[j]

print(c)
x = int(input())

for a in range(1, 10**9):
    if (x%(a-b) != 0):
        continue
    
    tmp = a**5 - x
    if (tmp <= 0):
        tmp *= -1
        
    b = tmp**(1/5)
    if(b == int(b)):
        print(a, int(b))
        break

### FIXED CODE ###

x = int(input())

for a in range(10**4):
    for b in range(10**4):
        if(a**5 + b**5 == x):
            print(a, -b)
            break
        elif(a**5 - b**5 == x):
            print(a, b)
            break
    else:
        continue
    break
S=input()
if S==SUN:
  print('7日後')
  elif S==MON:
    print('6日後')
  elif S==TUE:
    print('5日後')
  elif S==WED:
    print('4日後')
  elif S==THU:
    print('3日後')
  elif S==FRI:
    print('2日後')
  else S==SAT:
    print('1日後')

### FIXED CODE ###

S=input()
if S=='SUN':
  print('7')
elif S=='MON':
  print('6')
elif S=='TUE':
  print('5')
elif S=='WED':
  print('4')
elif S=='THU':
  print('3')
elif S=='FRI':
  print('2')
else:
  print('1')
from heapq import heapify, heappush, heappop
N = int(input())
heap = []
heapify(heap)
for i in range(1, int(N**(0.5))):
    if N % i == 0:
        heappush(heap, i - 1 + N // i - 1)
print(heappop(heap))

### FIXED CODE ###

from heapq import heapify, heappush, heappop
N = int(input())
heap = []
heapify(heap)
for i in range(1, int(N**(0.5)) + 1):
    if N % i == 0:
        heappush(heap, i - 1 + N // i - 1)
print(heappop(heap))
a,b,x = list(map(int,input().split()))

if(x<a+b):
    print(0)
    exit()

# 桁数を求める
r=0
s=0
j=0
for i in range(10):
    j+=1         # Nの桁数
    r=10**i      # j桁の最小整数
    s=a*r+b*j
    if(s>x):
        break    # j桁の最小数がxを超えた

# Nはj-1桁
j=j-1

xr = x - b*j
n = xr // a
if (n>10**9):
    n=10**9

#print('j: {}'.format(j))

print(n)


### FIXED CODE ###

weekday = {0:'SUN', 1:'MON', 2:'TUE', 3:'WED', 4:'THU', 5:'FRI', 6:'SAT'}
s=input()
for i in range(0, 7):
    if (weekday[i] == s):
        print(7-i)
# -*- coding: utf-8 -*-
import functools
import math

# スペース区切りの整数の入力
N, X = map(int, input().split())
pos = [int(x.strip()) for x in input().split()]

# 一番近い場所を検索
tikai = [i - X for i in pos]
kyori = list(map(abs,tikai))

gcd = functools.reduce(math.gcd, kyori)

print(gcd)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from fractions import gcd

# スペース区切りの整数の入力
N, X = map(int, input().split())
pos = [int(x.strip()) for x in input().split()]

# 一番近い場所を検索
tikai = [i - X for i in pos]
kyori = list(map(abs,tikai))

a = kyori[0]
for xi in kyori[1:]:
    a = gcd(a, xi)
print(a)
a = int(input())
b = int(input())
h = int(input())

print((a + b) * h / 2))


### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())

print(int((a + b) * h / 2))
n,k=map(int,input().split())
d=list(map(int,input().split()))
N=list(str(n))
for i in range(len(N)):
  N[i]=int(N[i])
for i in range(n,n*10+1):
  if not N.isdisjoint(d):
    print(i)
    exit()

### FIXED CODE ###

n,k=map(int,input().split())
d=list(map(int,input().split()))
for i in range(n,n*10+1):
  N=list(str(i))
  for j in range(len(N)):
    N[j]=int(N[j])
  N=set(N)
  d=set(d)
  if N.isdisjoint(d):
    print(i)
    exit()