Harryxun/stf_run huggingface dataset:
def solve(d,c,s,k):
    last=[0]*27
    srate=[]
    ans=[]
    for i in range(1,d+1):
        a=0
        for j in range(1,27):
            a-=c[j-1]*(i-last[j])
        pa=0
        mlast=[0]*2
        for t in range(1,27):
            if s[i-1][t-1]+c[t-1]*(min(k*(k-1)/2,(366-d)*((366-d)-1)/2))>pa:
                mlast=[t,i]
                pa=s[i-1][t-1]+c[t-1]*(i-last[t])
        a+=pa
        last[mlast[0]]=mlast[1]           
        ans.append(mlast[0])
        srate.append(a)
    return ans,srate

def main():
    d=int(input())
    c=list(map(int,input().split()))
    s=[list(map(int,input().split())) for _ in range(d)]
    mrate=0
    for i in range(26):
        a,srate=solve(d,c,s,i)
        if mrate<srate[-1]:
            ans=a
            mrate=srate[-1]
    for i in ans:
        print(i)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    d=int(input())
    c=list(map(int,input().split()))
    s=[list(map(int,input().split())) for _ in range(d)]
    last=[0]*27
    ans=[]
    for i in range(1,d+1):
        a=0
        for j in range(1,27):
            a-=c[j-1]*(i-last[j])
        pa=0
        mlast=[0]*2
        for t in range(1,27):
            if s[i-1][t-1]+c[t-1]*(i-last[j])>pa:
                mlast=[t,i]
                pa=s[i-1][t-1]+c[t-1]*(i-last[j])
        a+=pa
        last[mlast[0]]=mlast[1]           
        ans.append(mlast[0])
    for i in ans:
        print(i)

if __name__ == '__main__':
    main()
A = list(map(int,input().split))
A.sort
print(A[2]-A[0])

### FIXED CODE ###

A = list(map(int,input().split()))
A.sort()
print(A[2]-A[0])
n,x=map(int,input().split())
a=sorted(list(map(int,input().split())))
s=a[0]
i=0
while s<=x:
  i+=1
  s+=a[i]
print(i)

### FIXED CODE ###

n,x=map(int,input().split())
a=sorted(list(map(int,input().split())))
for i in range(n):
  x=x-a[i]
  if x<0:
    break
if i==n-1 and x==0:
  i+=1
print(i)
#!/usr/bin/env python
# -*- coding: utf-8 -*-

al = [0, 5] + [0] * 49
bl = [0, 3] + [0] * 49


def solve2(ans, x, idx, cnt):
    if idx == 1:
        return ans + (0, 0, 1, 2, 3, 3, 3)[x] + [0, 1][cnt >= 1]
    if x == (al[idx] // 2) + 1:
        return ans + bl[idx - 1] + 1 + [0, 1][cnt >= 1]
    elif x > (al[idx] // 2) + 1:
        ans += bl[idx - 1]
        x -= (al[idx] // 2)
        cnt += 1
    return solve2(ans, x, idx - 1, cnt)


def solve():
    n, x = map(int, input().split())
    for i in range(2, n + 1):
        al[i] = al[i - 1] * 2 + 3
        bl[i] = bl[i - 1] * 2 + 1
    ans = solve2(0, x, n, 0)
    print(ans)


if __name__ == "__main__":
    solve()


### FIXED CODE ###

d = int(input())
if d == 25:
  print("Christmas")
elif d == 24:
  print("Christmas Eve")
elif d == 23:
  print("Christmas Eve Eve")
elif d == 22:
  print("Christmas Eve Eve Eve")
a,b=map(int,input().replace(" "))
print(["Even","Odd"][(a*b)%2])

### FIXED CODE ###

a,b=map(int,input().split(" "))
print(["Even","Odd"][(a*b)%2])
a = list(map(input()))
b = list(map(input()))

k = max(len(a),len(b))

dp = [['']*(len(b)+1) for i in range(len(a))]

for i in range(len(a)):
	for j in range(len(b)):
		if a[i] == b[j]:
			dp[i+1][j+1] = dp[i][j] + 1
		else:
			dp[i+1][j+1] = max(dp[i+1][j],dp[i][j+1])

global ans = ""

def rec(m,n):
	if m == 0 and n == 0:
		return ans
	if a[m-1] == b[n-1]:
		ans += a[m]
		rec(m-1.n-1)
	elif dp[m-1][n] > dp[m][n-1]:
		rec(m-1,n)
	else:
		rec(m,n-1) 

rec(len(a),len(b))
print(ans)

### FIXED CODE ###

a = input()
b = input()

aa = len(a)

bb = len(b)

dp = [[0]*(bb+1) for i in range(aa+1)]

for i in range(aa):
	for j in range(bb):
		if a[i] == b[j]:
			dp[i+1][j+1] = dp[i][j] + 1
		else:
			dp[i+1][j+1] = max(dp[i][j+1],dp[i+1][j])

ans = ""

while aa > 0 and bb > 0:
	if a[aa-1] == b[bb-1]:
		aa -= 1
		bb -= 1
		ans += a[aa]
	elif dp[aa][bb-1] > dp[aa-1][bb]:
		bb -= 1
	else:
		aa -= 1
print(ans[::-1])
N = int(input)
S = input()
count = 0
for i in range(1,N-1):
  if S[i-1] + S[i] + s[i+1] == "ABC":
    count += 1
	print (count)

### FIXED CODE ###

N = int(input())
S = input()
print(S.count("ABC"))
a,b,c = map(int,input().split())
count = 0
for i in range(a:b-1):
    if c % i == 0:
        count +=1
    print(count)


### FIXED CODE ###

a,b,c = map(int,input().split())
count = 0
for i in range(a,b+1):
    if c % i == 0:
        count +=1
print(count)
n = list(input())
x = 0
for i in n:
    x += int(i)
if i%9 == 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = list(input())
x = 0
for i in n:
    x += int(i)
if x%9 == 0:
    print('Yes')
else:
    print('No')
x,y,z=(input().split(" "))
if z == y:
  if y ==x:
    return("No")
  else:
    return("Yes")
else:
  if z ==x:
    return("Yes")
  else:
    if y == x:
      return("Yes")
    else:
      return("No")


### FIXED CODE ###

x,y,z=(input().split(" "))
if z == y:
  if y ==x:
    print("No")
  else:
    print("Yes")
else:
  if z ==x:
    print("Yes")
  else:
    if y == x:
      print("Yes")
    else:
      
      print("No")
n=int(input())
f=[]
for a in range(1,n+1):
    if n%a==0:
        b=n//a
        f.append(max(len(a),len(b)))
print(min(f))

### FIXED CODE ###

import math
n=int(input())
f=[]
for a in range(1,math.floor(n**(1/2))+1):
    if n%a==0:
        b=n//a
        f.append(len(str(b)))
print(min(f))
n = int(input())
a = [[0]*n for i in range(n)]
  
for i in range(n):
    v = list(map(int, input().split()))
    u = v[0]
    k = v[1]
    for j in range(k):
        a[u - 1][v[2 + j] - 1] = 1

d = [0] * n    ## time:discover
f = [0] * n    ## time:finish
isDiscovered = [False] * n
time_stamp = 0

def dfs(u):
    global time_stamp
    isDiscovered [u - 1] = True
    time_stamp++
    d[u - 1] = time_stamp
    for i in range(n):
        if a[u - 1][i] == 1 and isDiscovered[i] == False:
            dfs(i)
    time_stamp++
    f[u - 1] = time_stamp

for i in rane(n):
    print(i+1, d[i], f[i])

### FIXED CODE ###

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

for i in range(n):
    v = list(map(int, input().split()))
    u = v[0] - 1
    for j in v[2:]:
        a[u].append(j-1)

d = [0] * n
f = [0] * n
isDiscovered = [False] * n
time_stamp = 0

def dfs(x):
    global time_stamp
    isDiscovered [x] = True
    time_stamp += 1
    d[x] = time_stamp
    for i in a[x]:
        if not isDiscovered[i]:
            dfs(i)
    time_stamp += 1
    f[x] = time_stamp

for i in range(n):
    if not isDiscovered[i]:
        dfs(i)

for i in range(n):
    print(i+1, d[i], f[i])
import sys
import itertools
import math

if __name__ == "__main__":
    N = int(sys.stdin.readline())

    for i in range(1, N+1):
        ans = 0
        ls = range(1, int(math.sqrt(i)))
        # ls = range(1, int(math.sqrt(i))-2*i)
        # print(ls)
        for (x,y,z) in sorted(itertools.combinations_with_replacement(ls, 3), key=lambda x: (sum(x), max(x))):
            tmp = x**2+y**2+z**2+x*y+y*z+z*x
            if tmp > i:
                break
            elif i == tmp:
                ans += 1
                if x == y and y == z:
                    continue
                elif x == y or y == z or z == x:
                    ans += 3-1
                else:
                    ans += 6-1
        print(ans)

### FIXED CODE ###

import sys

if __name__ == "__main__":
    L, R, d = list(map(lambda x: int(x), sys.stdin.readline().split()))
    ans = sum([1 if i % d == 0 else 0 for i in range(L, R+1)])
        
    print(ans)
a,b,x=map(int,input().split())
c=0
for i in range(a,b+1):
  if x%i==0:
    c+=1
print(a)

### FIXED CODE ###

a, b, x = [int(x) for x in input().split()]
print((b//x)-((a-1)//x))
S = input()

if len(S) % 2 != 0:
  matched = False
else:
  matched = True
  index = len(S)//2
  for i in range(index+1):
  	if S[i] != S[index+1]
    	matched = False
        break
        
if mathed:
  print('Yes')
else:
  print('False')
      
      

### FIXED CODE ###

N = input()
S = input()
index = len(S) // 2

if len(S) % 2 != 0:
  print('No')
elif S[:index] != S[index:]:
  print('No')
else:
  print('Yes')
N=int(input())
a=list(map(int, input().split()))
Flag=True

#print(bin(a[N-1] ^ a[1]))
#print(bin(a[0]))

if bin(a[N-2] ^ a[0]) == bin(a[N-1]):
  if bin(a[N-1] ^ a[1]) == bin(a[0]):
    for i in range(0,N-3):
      #print(bin(a[N] ^ a[N+2]),bin(a[N+1]))
      if Falg:
        if bin(a[N] ^ a[N+2])!=bin(a[N+1]):
          Flag=False
          break  
    else:
      print("Yes")
  else:
    print("No")
    
else:
  print("No")
    

### FIXED CODE ###

from collections import Counter,OrderedDict

N=int(input())
a=list(map(int,input().split()))
d=OrderedDict(Counter(a))
e=list(d)
e.sort()

if len(d)>3:
    ans="No"
else:
    ans="No"
    if len(d)==1:
        if e[0]==0:
            ans="Yes"
    elif len(d)==2:
        if N%3==0:
            if e[0]==0 and d[0]==N//3 and d[e[1]]==2*N//3:
                ans="Yes"
    else:
        if N%3==0:
            if d[e[0]]==d[e[1]]==d[e[2]]:
                if e[0]^e[1]^e[2]==0:
                    ans="Yes"
                   
print(ans)
a, b, c = map(int, input().split())
if(c >= a && c <= b):
  print("Yes")
else:
  print("No")
    



### FIXED CODE ###

a, b, c = map(int, input().split())
if(c >= a and c <= b):
  print("Yes")
else:
  print("No")
s=input()
from collections import Counter
c=Counter(s)
if most_common(c)[0]>1:
  print("no")
else:
  print("yes")

### FIXED CODE ###

s=input()
from collections import Counter
c=Counter(s)
if c.most_common()[0][1]>1:
  print("no")
else:
  print("yes")
import numpy as np

n = int(input())
l = list( map(int, input().split())) 
ans = 0

lsorted = np.sort(np.array(l))[::-1]

for longest in range(len(l)-2):

    for second in range(longest+1, len(l)):
        if lsorted[longest] - 2*lsorted[second] >= 0:
            break 
        ans += np.count_nonzero(lsorted[second+1:] > (lsorted[longest] - lsorted[second]) )
print(ans)


### FIXED CODE ###

from bisect import bisect_left

n = int(input())
l = list( map(int, input().split())) 
ans = 0
l.sort()

for i in range(n-2):
    shortest = l[i]
    for j in range(i+1, n-1):
        second = l[j]
        # このスライスしたやつと地味にTLEになる...
        # k = bisect_left(l[j], shortest + second)
        # ans += k

        k = bisect_left(l, shortest + second)
        ans += k - j - 1

print(ans)
N = int(input())

import math

kmax1 = (N+1/4)**(1/2)-1/2


kmax = min(kmax1, kmax2)

acc = 0
for k in range(1, int(kmax+1)):
    if((N-k)%k==0&N>k):
        acc+=(N-k)/k
print(int(acc))

### FIXED CODE ###

N = int(input())

kmax = (N+1/4)**(1/2)-1/2

acc = 0
for k in range(1, int(kmax+1)):
    m = (N-k)//k
    if(((N-k)%k==0)&(k<m)):
        acc+=m
print(int(acc))
n = input()
m = input()
print(math.factorial(n+m))

### FIXED CODE ###

n,m = map(int,input().split())
print(int(n*(n-1)/2 + m*(m-1)/2))
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    ans = 0
    changing = [a[0]]
    direct_flag = False #False > True <
    for i in range(1,n):
        if len(changing) == 1:
            changing.append(a[i])
            if changing[0] < changing[1]:
                direct_flag = True
        else:
            if direct_flag and changing[-1] < a[i]:
                changing.append(a[i])
            elif not direct_flag and changing[-1] > a[i]:
                changing.append(a[i])
            else:
                m = len(changing)
                iterange = (range(m) if direct_flag else range(m)[::-1])
                for j in iterange:
                    if j != 0:
                        makable = min(changing[j-1],changing[j])
                        ans += makable
                        changing[j-1] -= makable
                        changing[j] -= makable
                    if j != m-1:
                        makable = min(changing[j],changing[j+1])
                        ans += makable
                        changing[j] -= makable
                        changing[j+1] -= makable
                    if changing[j] >= 2:
                        makable = changing[j] // 2
                        ans += makable
                        changing[j] -= makable * 2
                changing = [a[i]]
                direct_flag = False
        if i == n-1:
            if len(changing) == 1:
                ans += changing[0] // 2
            else:
                iterange = (range(m) if direct_flag else range(m)[::-1])
                for j in iterange:
                    if j != 0:
                        makable = min(changing[j-1],changing[j])
                        ans += makable
                        changing[j-1] -= makable
                        changing[j] -= makable
                    if j != m-1:
                        makable = min(changing[j],changing[j+1])
                        ans += makable
                        changing[j] -= makable
                        changing[j+1] -= makable
                    if changing[j] >= 2:
                        makable = changing[j] // 2
                        ans += makable
                        changing[j] -= makable * 2
    print(ans)
if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    ans = 0
    for i in range(n):
        if a[i] == 0:
            continue
        ans += a[i]//2
        if i != n-1 and a[i]&1 and a[i+1] != 0:
            ans += 1
            a[i+1] -= 1
    print(ans)
if __name__ == "__main__":
    main()
a = input()
b= input()
x = a*b
def odd_even():
    if x%2==0:
        return "Odd"
    else:
        return"Even"

odd_even(x)


### FIXED CODE ###

a,b = map(int,input().split())
if (a*b)%2==0:
    print("Even")
else:
    print("Odd")
s = input()
if s[2] = s[3] and s[4] = s[5]:
    print('Yes')
else
    print('No')

### FIXED CODE ###

s = input()
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
A, B, C = (int, input().split())

if A == B == C:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if A == B == C:
    print("Yes")
else:
    print("No")
n = int(input())
f = []
for i in range(n):
    f.append(list(map(int, input().split())))
p = []
for i in range(n):
    p.append(list(map(int, input().split())))
count = {}
ans = []
for bits in range(1 << 10):
    count = {}
    for i in range(10):
        if (bits >> i & 1) == 1:
            for j in range(n):
                if j not in count: 
                    count[j] = f[j][i]
                else:
                    count[j] += f[j][i]
    if count != {}:
        if count[0] > 0 or count[1] > 0 or count[2] > 0: 
            check = p[0][count[0]] + p[1][count[1]] + p[2][count[2]]
            ans.append(check)
print(max(ans))

### FIXED CODE ###

n = int(input())
f = []
for i in range(n):
    f.append(list(map(int, input().split())))
p = []
for i in range(n):
    p.append(list(map(int, input().split())))
count = {}
ans = []
for bits in range(1 << 10):
    count = {}
    for i in range(10):
        if (bits >> i & 1) == 1:
            for j in range(n):
                if j not in count: 
                    count[j] = f[j][i]
                else:
                    count[j] += f[j][i]
    if count != {}:
        flag = 0
        for k in range(n):
            if count[k] != 0:
                flag = 1
        if flag:
            check = 0
            for l in range(n):
                check += p[l][count[l]]
            ans.append(check)
print(max(ans))
import math 


x1, y1, x2, y2 = map(int, raw_input().split())

print sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))

### FIXED CODE ###

from math import sqrt, pow

x1, y1, x2, y2 = map(float, raw_input().split())

print sqrt(pow((x2-x1), 2)+pow((y2-y1), 2))
N = int(input())
R = int(input())

if N < 10:
    ans = R + (100 * (10 - N))
    print(ans)
else:
    print(R)

### FIXED CODE ###

N, R = map(int, input().split())

if N < 10:
    ans = R + (100 * (10 - N))
    print(ans)
else:
    print(R)
# -*- coding: utf-8 -*-

H, W = map(int, input().split())

if H%2 == 0:
    ans = H//2 * W

else:
    ans = ((H//2)+1)*W - (W//2)

print(ans)

### FIXED CODE ###

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

K=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

a = int(input())

num = a-1
print(K[num])
from math import sqrt, inf

a = []


def dis(n):
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            a.append(int(i))


num = int(input())
dis(num)
ans = inf
for e in a:
    ans = min(ans, e + num / e - 2)
print(int(ans))


### FIXED CODE ###

def solve(n):
    ans = int(1e12)
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0 and i + n // i - 2 < ans:
            ans = i + n // i - 2
    return int(ans)


num = int(input())
print(solve(num))
import math
A, B = map(int, input().split())
if math.gcd(A, B) == A:
    print(A + B)
else:
    print(B-A)


### FIXED CODE ###

from fractions import gcd
A, B = map(int, input().split())
if gcd(A, B) == A:
    print(A + B)
else:
    print(B-A)
a, b = list(map(int, input().split()))

def gcd(num):
    k = []
    for i in [1,2]+list(range(3, num+1, 2)):
      if i > 2 and i%2 ==0:
        continue
      else:
        if num%i == 0:
            k.append(i) 
    return k

def is_prime(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True

ka = gcd(a)
kb = []
for i in ka:
  if b%i == 0:
    if is_prime(i):
        kb.append(i)

print(len(kb))

### FIXED CODE ###

def f(n):
    res = set()
    for i in range(2, int(n ** 0.5)):
        if n % i: continue
        while not n % i: n //= i
        res.add(i)
    return res | {n}
 
a, b = map(int,input().split())
print(len(f(a) & f(b) | {1}))
from scipy.special import comb
N, K = map(int, input().split())
MOD = 10 ** 9 + 7

def f2(N, K):
    return comb(N+K-1, K-1, exact=True) % MOD

def f(N, K):
    if (N < K): return 0
    if N == 0 and K == 0: return 1
    if (K < 1): return 0
    return f2(N-K, K)


for i in range(1,K+1):
    blue = f(K, i)
    red = 0
    red += f(N-K, i-1)
    red += f(N-K, i) * 2 % MOD
    red += f(N-K, i+1) % MOD
    
    print(red * blue % MOD)

### FIXED CODE ###

from operator import mul
from functools import reduce

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


def comb(N, R):
    R = min(N-R, R)
    if R == 0: return 1
    over = reduce(mul, range(N, N - R, -1))
    under = reduce(mul, range(1,R + 1))
    return over // under % MOD


def f2(N, K):
    return comb(N+K-1, K-1)

def f(N, K):
    if (N < K): return 0
    if N == 0 and K == 0: return 1
    if (K < 1): return 0
    return f2(N-K, K)


for i in range(1,K+1):
    blue = f(K, i)
    red = 0
    red += f(N-K, i-1)
    red += f(N-K, i) * 2 % MOD
    red += f(N-K, i+1) % MOD
    
    print(red * blue % MOD)
# -*- coding: utf-8 -*-
from math import factorial

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

def ncr(n, r):
    return factorial(n) // (factorial(r) * factorial(n - r)) % (10**9 + 7)

for i in range(1, K+1):
    print(ncr(K-1, i-1) * ncr(N-K+1, i))

### FIXED CODE ###

# -*- coding: utf-8 -*-
from math import factorial

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

def ncr(n, r):
    return factorial(n) // (factorial(r) * factorial(n - r)) 

for i in range(1, K+1):
    if i <= N-K+1:
        print(ncr(K-1, i-1) * ncr(N-K+1, i) % (10**9 + 7))
    else:
        print(0)
print(int(open(0)[0][0])//2)

### FIXED CODE ###

#print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
import math
def resolve():
    N,M=pin()
    print(math.ceil((N-1)/(M-1)))

#%%submit!
resolve()
##import math

x = int(input())
counter = 0
goukei = 100

while goukei < x:
    counter += 1
    goukei += int(1 + counter * 0.01)
    print(goukei)

    
print(counter)





### FIXED CODE ###


x = int(input())
counter = 0
goukei = 100

while goukei < x:
    goukei += int( goukei * 0.01)
    counter += 1
    
print(counter)
import sys

# utils
def read_numbers():
    return [int(num) for num in sys.stdin.readline().split()]
def read_string():
    return sys.stdin.readline().rstrip('\r\n')
def list2str(*array):
    return ' '.join([str(i) for i in array])

def main(N, A):
    return N*N - A

def parse_stdin():
    # N = read_numbers()
    # data = []
    # for i in range(N):
    #    data.append(read_numbers())
    N = read_numbers()[0]
    A = read_numbers()[0]
    return N, A

def test_main():
    """run pytest stdin.py to test"""
    #assert main([1,2], 'hi') == '3 hi'
    pass

if __name__ == '__main__':
    N, A = parse_stdin()
    result = main(nums, line)
    print(result)

### FIXED CODE ###

import sys

# utils
def read_numbers():
    return [int(num) for num in sys.stdin.readline().split()]
def read_string():
    return sys.stdin.readline().rstrip('\r\n')
def list2str(*array):
    return ' '.join([str(i) for i in array])

def main(N, A):
    return N*N - A

def parse_stdin():
    # N = read_numbers()
    # data = []
    # for i in range(N):
    #    data.append(read_numbers())
    N = read_numbers()[0]
    A = read_numbers()[0]
    return N, A

def test_main():
    """run pytest stdin.py to test"""
    #assert main([1,2], 'hi') == '3 hi'
    pass

if __name__ == '__main__':
    N, A = parse_stdin()
    result = main(N, A)
    print(result)
import numpy as np
def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    connect = np.ones((N, N), dtype=int)
    for _ in range(M):
        A, B = map(int, input().split())
        A -= 1
        B -= 1
        connect[A, B] = H[A] - H[B]
        connect[B, A] = H[B] - H[A]
    num = 0
    for i in range(N):
        if len(np.where(connect[i, :] <= 0)[0])  == 0:
            num += 1
    print(num)
        
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    violate = []
    for _ in range(M):
        A, B = map(int, input().split())
        A -= 1
        B -= 1
        if H[A] == H[B]:
            violate.append(A)
            violate.append(B)
        elif H[A] - H[B] < 0:
            violate.append(A)
        elif H[B] - H[A] < 0:
            violate.append(B)
    violate = list(set(violate))
    num = N - len(violate)
    print(num)
        
if __name__ == '__main__':
    main()
s = input()
t = input()

s_2 = "".join(sorted(s))
t_2 = "".join(sorted(t,reverse = True)

if s_2 < t_2 :
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()
t = input()

s_2 = "".join(sorted(s))
t_2 = "".join(sorted(t,reverse = True))

if s_2 < t_2 :
    print("Yes")
else:
    print("No")
o = input()
e = input()

pw = ""
for i in range(len(o)):
    pw += o[i] + e[i]
else:
    print(pw)

### FIXED CODE ###

o = input()
e = input()

pw = ""
lene = len(e)
for i in range(lene):
    pw += o[i] + e[i]
else:
    if lene < len(o):
        pw += o[-1]
    print(pw)
A1_1,A1_2,A1_3 = map(int, input().split())
A2_1,A2_2,A2_3 = map(int, input().split())    
A3_1,A3_2,A3_3 = map(int, input().split())
N = int(input())
B = []
for _ in range(N):
    S.append(input())

a=str('yes')
b=str('no')
if A1_1 in B and A1_2 in B and A1_3 in B:
     print(a)
elif A2_1 in B and A2_2 in B and A2_3 in B:
    print(a)
elif A3_1 in B and A3_2 in B and A3_3 in B:
     print(a)
elif A1_1 in B and A2_1 in B and A3_1 in B:
    print(a)
elif A1_2 in B and A2_2 in B and A3_2 in B:
    print(a)
elif A1_3 in B and A2_3 in B and A3_3 in B:
    print(a)
elif A1_1 in B and A2_2 in B and A3_3 in B:
     print(a)
elif A1_3 in B and A2_2 in B and A3_1 in B:
    print(a)
else:
    print(b)

### FIXED CODE ###

A1_1,A1_2,A1_3 = map(int, input().split())
A2_1,A2_2,A2_3 = map(int, input().split())
A3_1,A3_2,A3_3 = map(int, input().split())
N =int(input())
B = []
for _ in range(N):
    B.append(int(input()))

a=str('Yes')
b=str('No')
if A1_1 in B and A1_2 in B and A1_3 in B:
     print(a)
elif A2_1 in B and A2_2 in B and A2_3 in B:
    print(a)
elif A3_1 in B and A3_2 in B and A3_3 in B:
     print(a)
elif A1_1 in B and A2_1 in B and A3_1 in B:
    print(a)
elif A1_2 in B and A2_2 in B and A3_2 in B:
    print(a)
elif A1_3 in B and A2_3 in B and A3_3 in B:
    print(a)
elif A1_1 in B and A2_2 in B and A3_3 in B:
     print(a)
elif A1_3 in B and A2_2 in B and A3_1 in B:
    print(a)
else:
    print(b)