Harryxun/stf_run huggingface dataset:
card = [[int(x) for x in input().split()] for y in range(3)]
bools = [[0,0,0],[0,0,0],[0,0,0]]
n = int(input())
for _ in range(n):
  x = int(input())
  for i in range(3):
    for j in range(3):
      if x == card[i][j]:
        bools[i][j] = 1
ok = False
for i in range(3):
  if (bools[i][0], bools[i][1], bools[i][2]) == (1,1,1) or 
  (bools[0][i], bools[1][i], bools[2][i]) == (1,1,1):
    ok = True
if (bools[0][0],bools[1][1],bools[2][2]) == (1,1,1) or (bools[0][2], bools[1][1], bools[2][0]) == (1,1,1):
  ok = True
print("Yes" if ok else "No")

### FIXED CODE ###

card = [[int(x) for x in input().split()] for y in range(3)]
bools = [[0,0,0],[0,0,0],[0,0,0]]
n = int(input())
for _ in range(n):
  x = int(input())
  for i in range(3):
    for j in range(3):
      if x == card[i][j]:
        bools[i][j] = 1
ok = False
for i in range(3):
  if (bools[i][0], bools[i][1], bools[i][2]) == (1,1,1) or (bools[0][i], bools[1][i], bools[2][i]) == (1,1,1):
    ok = True
if (bools[0][0],bools[1][1],bools[2][2]) == (1,1,1) or (bools[0][2], bools[1][1], bools[2][0]) == (1,1,1):
  ok = True
print("Yes" if ok else "No")
import itertools

def main():

    data = []
    while True:
        n, x = map(int, input().split())
        if [n, x] == [0, 0]: break
        data.append([n, x])

    for [n, x] in data:
        _set = set(range(1, n+1))
        comb = set(itertools.combinations(_list, 3))
        print(sum((True if sum(i) == x else False) for i in comb))


main()

### FIXED CODE ###

import itertools

def main():

    data = []
    while True:
        n, x = map(int, input().split())
        if [n, x] == [0, 0]: break
        data.append([n, x])

    for [n, x] in data:
        _set = set(range(1, n+1))
        comb = set(itertools.combinations(_set, 3))
        print(sum((True if sum(i) == x else False) for i in comb))


main()
import fraction

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

x = math.gcd(a[0],a[1])

if n != 2:
    for i in range(2,n):
        x = math.gcd(x,a[i])
        
print(x)

### FIXED CODE ###

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

if b % a == 0:
    print(b+a)
else:
    print(b-a)
N=int(input())
s=input()
tmp=[s[:i].count("#")+s[i:N].count(".") for i in range(N+1)]
print(min(tmp))


### FIXED CODE ###

a,b,c=map(int, input().split())
if a>b:
    goal=a
    start=b
else:
    goal=b
    start=a
    
ans="No"
if c>start and c<goal:
    ans="Yes"
print(ans)
H, W = (int(i) for i in input().split())
str = [input() for i in range(H)]
print(str)

for i in range(W+2):
        print("#", end = "")
print("")

for i in range(H):
        print("#", end = "")
        print(str[i], end = "")
        print("#")

for i in range(W+2):
        print("#", end = "")
print("")

### FIXED CODE ###

listA = [1, 3, 5, 7, 8, 10, 12]
listB = [4, 6, 9, 11]
listC = [2]
a = {}
b = {}
c = {}

N = [int(i) for i in input().split()]

for i in range(2):
	a[i] = N[i] in listA
	b[i] = N[i] in listB
	c[i] = N[i] in listC


if a[0] == True and a[1] == True:
	print ("Yes")
elif b[0] == True and b[1] == True:
	print ("Yes")
elif c[0] == True and c[1] == True:
	print ("Yes")
else:
	print ("No")
def evenodd(a,b):
  if a*b%2==1:
    print("Odd")
  else:
    print("Even")
    
print(evenodd(a,b))
    

### FIXED CODE ###

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

def evenodd(a,b):
  if a*b%2==1:
    return "Odd"
  else:
    return"Even"
    
print(evenodd(a,b))
import sys
input = sys.stdin.readline

list={"A":"T","T":"A","G":"C","C":"G"}
b = input()
print(list[b])

### FIXED CODE ###

#import sys
#input = sys.stdin.readline

list={"A":"T","T":"A","G":"C","C":"G"}
b = input()
print(list[b])
N=int(input())
A=int(input())
print("Yes" if (N-a)%500==0 else "No")

### FIXED CODE ###

N=int(input())
A=int(input())
count=0
for i in range(0, A+1):
    if (N-i)%500 == 0:
        count=1
        break
print("Yes" if count==1 else "No")
N=int(input())

for h in range(N//4, min(3501, 3*N//4 +1)):
  for n in range((N*h)//(4*h-N), min(3501, (2*N*h)//(4*h-N))):
    x = 4*h*n - N*n - N*h
    y = N*h*n
    if x<=0 or y%x:
      continue
    else:
      print('{} {} {}'.format(h,n,y//x))
      exit()

### FIXED CODE ###

N=int(input())

if N==2:
  print('1 2 2')
  exit()

for h in range(N//4 +1, min(3501, 3*N//4 +1)):
  for n in range((N*h)//(4*h-N), min(3501, (2*N*h)//(4*h-N))):
    x = 4*h*n - N*n - N*h
    y = N*h*n
    if x>0 and not y%x:
      print('{} {} {}'.format(h,n,y//x))
      exit()
import numpy as np
N,K = map(int,input().split())
A = np.int32(input().split())

d = [0]*40
for k in range(40):
    d[k] = np.sum(min(A&2**k,1))

dd = [0]*41
for k in range(40):
    dd[k] = dd[k-1]+max(d[k],N-d[k])*2**k

dp = [0]*(40)

for k in range(40):
    if K&2**k == 0:
        dp[k] = dp[k-1]+d[k]*2**k
    else:
        dp[k] = max(dp[k-1]+(N-d[k])*2**k,dd[k-1]+d[k]*2**k)

print(dp[-1])

### FIXED CODE ###

from collections import defaultdict
N,K = map(int,input().split())
A = list(map(lambda x:bin(int(x))[2:],input().split()))
l = 0
for i in range(N):
    l = max(l,len(A[i]))
count = defaultdict(lambda:0)
for i in range(N):
    for j in range(len(A[i])):
        if A[i][-j-1] == '1':
            count[j] += 1
l = max(count.keys())

def rec(x):
    if x=='':
        return 0
    if '0' not in x:
        res = 0
        for i in range(len(x)):
            res += max(count[i],N-count[i])*2**i
        return res
    if x[0] == '1':
        return max(rec('1'*(len(x)-1))+count[len(x)-1]*2**(len(x)-1),rec(x[1:])+(N-count[len(x)-1])*2**(len(x)-1))
    else:
        return rec(x[1:])+count[len(x)-1]*2**(len(x)-1)
ans = rec(bin(K)[2:])
for i in range(len(bin(K)[2:]),l+1):
    ans += count[i]*2**i
print(ans)
n = int(input())
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))

ans = 0
prev = 0
for i in range(n):
  if a_list[i] == prev + 1:
    ans += b_list[i] + c_list[i]
  else:
    ans += b_list[i]
  prev = a_list[i]
print(ans)

### FIXED CODE ###

n = int(input())
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))

ans = 0
prev = -1
for i in range(n):
  if a_list[i] == prev + 1:
    ans += b_list[a_list[i] - 1] + c_list[prev - 1]
  else:
    ans += b_list[a_list[i] - 1]
  prev = a_list[i]
print(ans)
import math
N = int(input())
x = int(input())
y = int(input())

D = int(input())
distance = math.sqrt(x**2 + y**2)

count = 0
for i in range(1, N+1):
    if distance <= D:
        count += 1

print(count)

### FIXED CODE ###

import math
N, D = map(int, input().split()) #split()で空白区切り
count = 0
for i in range(N):
    x, y = map(int, input().split())
    if math.sqrt(x**2 + y**2) <= D:
        count += 1
print(count)
n,m = map(int,input().split())
alis = list(map(int,input().split()))
lis = [list(map(int,input().split())) for x in range(m)]
clis = [[x[1]]*x[0] for x in lis]
clis = [x for y in clis for x in y]
clis.sort(reverse=True)
l = len(clis)
alis.sort()
ans = 0
for x,y in zip(alis,clis):
    if x>=y:
        ans += x
    else:
        ans += y
print(a)
if n>l:
    ans += sum(alis[l:])
print(ans)


### FIXED CODE ###

n,m = map(int,input().split())
alis = list(map(int,input().split()))
lis = [list(map(int,input().split())) for x in range(m)]
for x in alis:
    lis.append([1,x])
lis.sort(reverse=True,key=lambda x:x[1])
ans = 0
for x in lis:
    (number,point) = x
    if number >= n:
        number = n
        ans += number * point
        #print(n)
        #print(ans,'+=',number,'*',point)
        break
    ans += number * point
    n -= number
    #print(n)
    #print(ans,'+=',number,'*',point)
print(ans)
#print(lis)
n, m = map(int, input().split())
# A = set()
# for i in range(m):
#     a = int(input())
#     A.add(a)
a = set()
for i in range(m):
    a.append(int(input()))
    A = a
dp = [0] * (n + 1)
for i in range(n + 1):
    if i in A:
        dp[i] = 0
    else:
        if i == 0:
            dp[i] = 1
        elif i == 1:
            dp[i] = 1
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007
print(dp[n])

### FIXED CODE ###

n, m = map(int, input().split())
A = set()
for i in range(m):
    a = int(input())
    A.add(a)
dp = [0] * (n + 1)
for i in range(n + 1):
    if i in A:
        dp[i] = 0
    else:
        if i == 0:
            dp[i] = 1
        elif i == 1:
            dp[i] = 1
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007
print(dp[n])

"""
100 5
1
23
45
67
89
"""
N,K = map(int, input().split())

g2 = [[0]*(K+1) for _ in range(K+1)]
def gcd(a, b):
    if g2[a][b] > 0:
        return g2[a][b]
    tmpa = a
    tmpb = b
    while b > 0:
        a,b = b, a%b
    g2[tmpa][tmpb] = a
    g2[tmpb][tmpa] = a
    return a

def gcd_3(a,b,c):
    g = gcd(a,b)
    g = gcd(g,c)
    return g

sm = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):

print(sm)


### FIXED CODE ###

K = int(input())

g2 = [[0]*(K+1) for _ in range(K+1)]
def gcd(a, b):
    if g2[a][b] > 0:
        return g2[a][b]
    tmpa = a
    tmpb = b
    while b > 0:
        a,b = b, a%b
    g2[tmpa][tmpb] = a
    g2[tmpb][tmpa] = a
    return a

def gcd_3(a,b,c):
    g = gcd(a,b)
    g = gcd(g,c)
    return g

sm = 0
for a in range(1, K+1):
    sm += a
    for b in range(a+1, K+1):
        for c in range(b+1, K+1):
            sm += gcd_3(a,b,c) * 6
    for b in range(1, K+1):
        if a != b:
            sm += gcd(a,b) * 3

print(sm)
O=input()
E=input()
T=""
for i in range(len(O)):
    T += O[i]+ E[i]
print(T)

### FIXED CODE ###

O=input()
E=input()
T=""
if len(O)-len(E)==0:
  for i in range(len(O)):
    T += O[i]+ E[i]
  print(T)
else:
  for i in range(len(E)):
    T += O[i]+ E[i]
  T+=O[-1]
  print(T)
n,a,b,c,d = map(int,input().split())
s = list(input())
for j in range(n):
    if s[j]=='#':
        able[j] = -1
        
if d<c:
    flag3 =  False
    for i in range(b,d):
        if s[i]=='.':
            if s[i-1]=='.':
                if s[i+1]=='.':
                    flag3 = True
                    
    if not flag3:
        print('No')
    else: 
        flag =True
        for i in range(b,d-1):
            if s[i]=="#" and s[i+1]=="#":
                flag = False

        for i in range(a,c-1):
            if s[i]=="#" and s[i+1]=="#":
                flag = False

        if flag:
            print('Yes')
        else:
            print('No')

else:
    flag =True
    for i in range(b,d-1):
        if s[i]=="#" and s[i+1]=="#":
            flag = False
        
    for i in range(a,c-1):
        if s[i]=="#" and s[i+1]=="#":
            flag = False

    if flag:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

n,a,b,c,d = map(int,input().split())
s = input()
if d<c:
    if "##" not in s[a-1:d] and '...' in s[b-2:d+1]:
        print('Yes')
    else:
        print('No')
    
else:
    if "##" not in s[a-1:d]:
        print('Yes')
    else:
        print('No')
import numpy as np
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    for i in range(n):
        std = np.std(s)
    print("{0:.8f}".format(std))

### FIXED CODE ###

import math
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    m = sum(s) / n
    z = sum([(float(s[i])-m)**2 for i in range(n)])
    b = z / n
    print("{0:.8f}".format(math.sqrt(b)))
def convert(S): 
    str1 = ""  # initialization of string to "" 
    return(str1.join(S))    # using join function join the list s by  
                            # separating words by str1


K = int(input())    # take K from user
readtext= str(input())  # take the input string 

S = list(readtext)   #split the string into charactrers and put them to list
list1=list()  #list 1 

for i in range (0 , K): # for looop to append the charachters to the new list
    a = S[i]
    list1.append(a) # appending the charachters to the list
if len(list1) > K:  # condition when number of charachters is big than K
    b = "..."
    list1.append(b) # append the 3 dots 

print(convert(list1)) # convert the list of characters back to the string format
    
    


### FIXED CODE ###

#K input for the range of S
K = int(input())
#input of lowercase english letters
S = input()
if len(S) > K:
    print(S[:K] + "...")
else:
    print(S)
S,T = map(str,input().split())
ans = False
for i in range(len(S)):
    if list(S) == [list(T)[(i+j)%(len(T))] for j in range(len(T))]:
        ans = True
if ans:
    print('Yes')
if not ans:
    print('No')

### FIXED CODE ###

S = input()
T = input()
ans = False
for i in range(len(S)):
    if list(S) == [list(T)[(i+j)%(len(T))] for j in range(len(T))]:
        ans = True
if ans:
    print('Yes')
if not ans:
    print('No')
N = int(input())
A = list(map(int, input().split()))
B = [0] * (N+1)

for i in A:
    B[i] += 1
sum_original = sum(j*(j-1)//2 for j in B)
for k in range(N):
    print(sum_original - (B[A[k]]+1)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = [0 for _ in range(max(a)+1)]
for x in a:
    b[x] += 1
c = sum([x*(x-1)//2 for x in b])
for i in range(n):
    print(c-b[a[i]]+1)
n = int(input())
A = [int(input()) for i in range(n)] 

b = list()
for a in A:
    b.add(a)
    if len(set(b)) != len(b):
        b.pop(-1)
        b.remove(a)
print(len(b))
    

### FIXED CODE ###

n = int(input())
A = [int(input()) for i in range(n)]

b = set()
lenB = 0
for a in A:
    b.add(a)
    lenB += 1
    if len(b) != lenB:
        b.remove(a)
        lenB -= 2
print(len(b))
n,x,m=map(int,input().split())
l=[0]*m
s=[0]*m
t=p=0
while l[x]<1:
  l[x]=t
  s[x]=s[p]+x
  p=x
  x=pow(p,2,m)
  t+=1
T=t-l[x]
S=s[p]+x-s[x]
if n<=t:
  print(s[l.index((n-1)%m)])
else:
  print(S*((n-l[x])//T)+s[l.index((l[x]+(n-l[x])%T-1)%m)])

### FIXED CODE ###

n,x,m=map(int,input().split())
l=[-1]*m
s=[0]*m
t=p=0
while l[x]<0:
  t+=1
  l[x]=t
  s[x]=s[p]+x
  p=x
  x=pow(p,2,m)
T=t+1-l[x]
S=s[p]+x-s[x]
if n<l[x]:
  print(s[l.index(n)])
else:
  print(S*((n-l[x])//T)+s[l.index(l[x]+(n-l[x])%T)])
a,b,c,d=map(int,input().split())
def lcm(x,y):
    return (x*y)//math.gcd(x,y)
lm=lcm(c,d)
print(lm)

### FIXED CODE ###

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

a,b,c,d=map(int,input().split())
cn1=0
cn2=0
cn3=0
an1=0
an2=0
an3=0
cnt=0
ans=0
lm=(c*d)//gcd(c,d)

#bまで
cn1=b//c
cn2=b//d
cn3=b//lm
#aまで
an1=(a-1)//c
an2=(a-1)//d
an3=(a-1)//lm
#aからbまで
cn1=cn1-an1
cn2=cn2-an2
cn3=cn3-an3

cnt=cn1+cn2-cn3
ans=b-a-cnt+1

print(ans)
def main(L,R):
    mod_min = 2019
    if L // mod_min == R // mod_min:
        L %= mod_min
        R %= mod_min
        for i in range(L,R):
            for j in range(i+1, R+1):
                Y = i*j % 2019
                if Y < mod_min:
                    mod_min = Y
    else:
        mod_min = 0
    return mod_min
print(main(L,R))

### FIXED CODE ###

L,R = list(map(int,input().split()))
def main(L,R):
    mod_min = 2019
    if L // mod_min == R // mod_min:
        L %= mod_min
        R %= mod_min
        for i in range(L,R):
            for j in range(i+1, R+1):
                Y = i*j % 2019
                if Y < mod_min:
                    mod_min = Y
    else:
        mod_min = 0
    return mod_min
print(main(L,R))
a,b,c,d = map(int,input().split())
import math
rad = math.fabs((c/12 - d/60)*360)
rad = min(rad,360-rad)
cosine = (math.cos(math.radians(rad))
print((a**2+b**2 - 2*a*b*cosine)**0.5)

### FIXED CODE ###

a,b,c,d = map(int,input().split())
import math
rad = math.fabs((c/12 - d/60 + d/720)*360)
rad = min(rad,360-rad)/180
cosine = math.cos(rad*math.pi)
print((a**2+b**2 - 2*a*b*cosine)**0.5)
n=int(input())
t=len(n)
if t<4:
  print(1000-n)
else:
  k,p=n[0],k[1]
  if p!=0:
    print((k+1)*1000-n)
  else:
    print(0)
  


### FIXED CODE ###

n=input()
t=len(n)
if t<4:
  print(1000-int(n))
else:
  k=int(n[0])
  if int(n)>k*10**(t-1):
    print((k+1)*1000-int(n))
  else:
    print(0)
N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
P = [0] + [abs(i) for i in A if i> 0 ]
M = [abs(i) for i in A if i< 0 ] +[0]
M = sorted(M,reverse =False)

cnt = 10000000



#正の部分、負の部分の長さが0の場合エラーが起こる
#正の方向でi個ろうそくを通って、負の方向にK-i個ろうそくを通る
for i in range(1,K):
    cnt =min(cnt,P[i]*2 + M[K-i])
    cnt =min(cnt,M[i]*2 + P[K-i])
    #print(cnt)

print(cnt)

### FIXED CODE ###

N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
P = [0] + [abs(i) for i in A if i> 0 ]
M = [abs(i) for i in A if i< 0 ] +[0]
M = sorted(M,reverse =False)


cnt = 10000000000

if len(P) == len(M) == 1:
    cnt = 0
elif len(P) == 1:
    cnt = M[K]
elif len(M) == 1:
    cnt = P[K]
else:
    #リストがK以下の場合不具合が起きる
    #for i in range(1,K):   
    #len(P)=4 len(M)=3 K=5の場合、IndexErrorとなる。rangeをうまく設定する必要があるが実装できない。
    #正の方向でi個ろうそくを通って、負の方向にK-i個ろうそくを通る
    s = max(0,K-len(M)+1)
    e = min(K+1, len(P))
    for i in range(s, e):
        cnt =min(cnt,P[i]*2 + M[K-i])
    #負の方向でi個ろうそくを通って、正の方向にK-i個ろうそくを通る
    s1 = max(0,K-len(P)+1)
    e1 = min(K+1, len(M))
    for i in range(s1, e1):
        cnt =min(cnt,M[i]*2 + P[K-i])

print(cnt)
X = input()
a=X//500
b=(X-500*a)//5
print(1000*a+5*b)

### FIXED CODE ###

X = int(input())
a=X//500
b=(X-500*a)//5
print(1000*a+5*b)
N = int(input())
a = list(map(int,input().split()))

c = list()

for n in range(N):
    for i in range(1,30):
        if not a[n]%(2**i)==0:
            c.append(i-1)
            break
print(min(c))

### FIXED CODE ###

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

c = list()

for n in range(N):
    for i in range(1,31):
        if not a[n]%(2**i)==0:
            c.append(i-1)
            break
print(min(c))
N = int(input())
a = list(map(int, input().split()))

X = sum(a)
b = [a[0]]
for i in range(1, N):
    b.append(b[i-1] + a[i])

ans = []
for i in range(1, N):
    ans.append(abs(X - 2*b[i]))

print(min(ans))


### FIXED CODE ###

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

if A*B*(A+B) %3 == 0:
    print('Possible')
else:
    print('Impossible')
'''
Fuad Ashraful Mehmet
University of Asia Pacific,Bangladesh
Date: 7th May 2020
'''


n,k=[int(x) for x in input().split()]
vis=[-1 for i in range(n+4)]
node=0
a=[int(x) for x in input().split()]
a=[0]+a
#print(a)

def dfs(u,l,turn):
    if turn<=0:
        print(u)
        return -1
    if vis[u]!=-1:
        global node
        node=u
        #print("node "+str(node))
        return l-vis[node]
    vis[u]=l
    return dfs(a[u],l+1,turn-1)

diff=dfs(1,0,k)
if diff==-1:
    exit()
else:

    lo=1
    hi=10**25
    cost=vis[node]

    while lo<=hi:
        mid=(lo+hi)//2
        temp=mid*diff
        #print(lo,hi)
        if cost+temp<=k:
            lo=mid+1
        else:
            hi=mid-1


    t=hi*diff+cost
    #print("Node "+str(node))
    def dfs2(u,turn):
        if turn<=0:
            print(u)
            return
        
        dfs2(a[u],turn-1)

    dfs2(node,k-t)


### FIXED CODE ###

'''
Fuad Ashraful Mehmet
University of Asia Pacific,Bangladesh
Date: 7th May 2020
'''

n,k=map(int,input().split())
a=list(map(int,input().split()))
a=[0]+a
vis=[-1]*(n+5)


turn=k
now=1
c=0
while vis[now]==-1:

    if turn<=0:
        print(now)
        exit()
    vis[now]=c
    c+=1
    now=a[now]
    turn=turn-1

diff =c-vis[now]

lo=1
hi=10**25
cost=vis[now]
while lo<=hi:

    mid=(lo+hi)//2
    t=mid*diff
    if t+cost<=k:
       lo=mid+1
    else:
        hi=mid-1

t=hi*diff+cost


rem=k-t

while rem>0:
    now=a[now]
    rem-=1

print(now)
inData = input().split(' ')
mseCnt = int(inData[0])
mustCnt = int(inData[1])
neDanList = []
mseJ = {}
byCnt = 0
byMany = 0
for i in range(0, mseCnt):
    inData2 = input().split(' ')
    moji = int(inData2[0])
    mseJ[inData2[0]] = int(inData2[1])
    neDanList.append(inData2[0])

mseJ = sorted(mseJ.items())
neDanList = sorted(neDanList)

for i in range(0, mseCnt):
    for j in range(0, int(mseJ[i][1])):
        if byCnt == mustCnt:
            break
        else:
            byCnt += 1
            byMany += int(neDanList[i])
    if byCnt == mustCnt:
        break

print(byMany)

### FIXED CODE ###

N, M = map(int, input().split())
mseList = [list(map(int, input().split())) for i in range(0, N)]
mseList = sorted(mseList, key=lambda x:x[0])
total = 0
for i, k in mseList:
    if k < M:
        total += i * k
        M -= k
    else:
        total += i * M
        break
print(total)
s = inpput()
if ''.join(sorted(s)) == 'abc':
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s = input()
if ''.join(sorted(s)) == 'abc':
  print('Yes')
else:
  print('No')
import sys

input = sys.stdin.readline

d = '.'
dn = '#'

def isPaintable(h, w, x, y, canvas):
    ret = False
    if x > 0:
        if canvas[x-1, y] == dn:
            ret = True
    elif x < w:
        if canvas[x+1, y] == dn:
            ret = True
    elif y > 0:
        if canvas[x, y-1] == dn:
            ret = True
    elif y < h:
        if canvas[x, y+1] == dn:
            ret = True
    return ret

def main():
    ans = 'Yes'
    h, w = map(int, input().split())
    canavs = []
    for _ in range(h):
        s = list(input().split().rstrip('\n'))
        canvas.append(s)
    for i in h:
        if ans == 'No':
            break
        for j in w:
            if not isPaintable(h, w, j, i, canvas):
                ans = 'No'
                break
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

input = sys.stdin.readline

d = '.'
dn = '#'

def isPaintable(h, w, x, y, canvas):
    if x > 0:
        if canvas[y][x-1] == dn:
            return True
    if x < w-1:
        if canvas[y][x+1] == dn:
            return True
    if y > 0:
        if canvas[y-1][x] == dn:
            return True
    if y < h-1:
        if canvas[y+1][x] == dn:
            return True
    return False

def main():
    ans = 'Yes'
    h, w = map(int, input().split())
    canvas = []
    for _ in range(h):
        s = list(input().rstrip('\n'))
        canvas.append(s)
    for y in range(h):
        if ans == 'No':
            break
        for x in range(w):
            if canvas[y][x] == dn and not isPaintable(h, w, x, y, canvas):
                ans = 'No'
                break
    print(ans)

if __name__ == '__main__':
    main()
s=raw_input()
if s[3]==s[4] and s[5]==s[6]:
	print "Yes"
else:
	print "No"

### FIXED CODE ###

s=raw_input()
if s[2]==s[3] and s[5]==s[4]:
	print "Yes"
else:
	print "No"
i = list(map(lambda x:int(x),list(input().split(' ')))).sort()
if i[0] is i[1]+i[2]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

i = sorted(list(map(lambda x:int(x),list(input().split(' ')))))
if i[2] == i[1]+i[0]:
  print('Yes')
else:
  print('No')
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

h, n = map(int, input().split())
a = [int(i) for i in input().split()]

a.sort(key = lambda x : -1*x)

if h > a[0] + a[1]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

h, n = map(int, input().split())
a = [int(i) for i in input().split()]

d = 0
for i in a:
    d += i

if h > d:
    print("No")
else:
    print("Yes")