Harryxun/stf_run huggingface dataset:
k = int(input())
l = list(map(int, input.split()))
if l[1] - l[0] >= k:
  print("OK")
elif l[0] == l[1]:
  if l[0] % k == 0:
    print("OK")
  else:
    print("NG")
else:
    print("NG")

### FIXED CODE ###

k = int(input())
l = list(map(int, input().split()))
if (l[1] - l[0]) >= k or l[0] % k == 0 or l[1] % k == 0:
  print("OK")
else:
  while l[0] != l[1]:
    l[0] += 1
    if l[0] % k == 0:
      print("OK")
      exit()
  print("NG")
N = int(input())
A = list(map(int,input().split()))
ans = 0

#最大公約数を求めるfunction
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a  

def gcd_list(list,N):
  a = list[0]
  for i in range(1, N):
      b = gcd(a, list[i])
  return b

for i in range(N):
  newA = copy.copy(A)
  if i != N-1:
    newA[i] = newA[i+1]
  else:
    newA[i] = newA[i-1]
  ans = max(gcd_list(newA,N),ans)
print(ans)  

### FIXED CODE ###

from fractions import gcd
 
n = int(input())
a = list(map(int, input().split()))
 
rs, ls = [0], [0]
for i in range(n-1):
  rs.append(gcd(rs[i], a[i]))
  ls.append(gcd(ls[i], a[-i-1]))
 
print(max(gcd(r, l) for r, l in zip(rs, ls[::-1])))
s = input()
print("x"*len(s)-2)

### FIXED CODE ###

s = input()
print("x"*len(s))
N,L = map(int,input().split())
l = list(map(lambda x : L+x+1 , range(1,N+1)))
print(sum(l)-min(l,key=min))

### FIXED CODE ###

N,L = map(int,input().split())
l = list(map(lambda x : L+x-1 , range(1,N+1)))
print(sum(l)-min(l,key=abs))
n=int(input())
L=list(map(int,input().split()))
ans=[]
for i in range(n):
    if L[i]>i+1:
        print(-1)
        exit()
def mal(x):
    if len(x)==0:
        return []
    else:
        t=max(x)
        i=x.index(t)
        after=x[:i-t+1]
        before=x[i-t+1:]
        before.remove(t)
        return mal(before)+[t]+mal(after)
ans=mal(L)

for i in range(n):
    print(ans[i])

### FIXED CODE ###

n=int(input())
L=list(map(int,input().split()))
for i in range(n):
    if L[i]>i+1:
        print(-1)
        exit()
def mal(x):
    if len(x)==0:
        return []
    else:
        t=max(x)
        i=x.index(t)
        k=i-1
        while k>i-t:
            if x[k]>t-i+k:
                t=x[k]
                i=k
            k -= 1
        after=x[:i-t+1]
        before=x[i-t+1:]
        before.remove(t)
        return mal(before)+[t]+mal(after)
ans=mal(L)

for i in range(n):
    print(ans[i])
d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min(5,k-i+1)):
    p.append(d[i:i+j+1])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])


### FIXED CODE ###

d = input()
a = int(input())
p = []
k = len(d)
for i in range(k):
  for j in range(min({6,k-i+1})):
    p.append(d[i:i+j])
    
x = list(set(p))
x.sort()
del x[0]
 
print(x[a-1])
a, b, c = input().split()
print(chr(ord(a) + 26) + chr(ord(b) + 26) + chr(ord(c) + 26))

### FIXED CODE ###

a, b, c = input().split()
print(chr(ord(a[0]) - 32) + chr(ord(b[0]) - 32) + chr(ord(c[0]) - 32))
N=int(input())

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

color=[0,0,0,0,0,0,0,0]
alles=0

for i in range(N) :
    
    if a[i]<400 :
        color[0]+=1
    elif a[i]<800 :
        color[1]+=1
    elif a[i]<1200 :
        color[2]+=1
    elif a[i]<1600 :
        color[3]+=1
    elif a[i]<2000 :
        color[4]+=1
    elif a[i]<2400 :
        color[5]+=1
    elif a[i]<2800 :
        color[6]+=1
    elif a[i]<3200 :
        color[7]+=1
    else :
        alles+=1

        
while 0 in color :color.remove(0)
eight=int(8)

if alles>=8 :
    print(eight," ",eight)
elif alles+len(color)>=8 :
    if alles>=len(color) :
        print(alles," ",eight)
    else :
        print(len(color)," ",eight)
else :
    if alles>=len(color) :
        print(alles," ",len(color)+alles)
    else :
        print(len(color)," ",len(color)+alles)



### FIXED CODE ###

r,g,b=map(int,input().split())

s=r*100+g*10+b

if s%4==0:
    print("YES")
else :
    print("NO")
S, T = map(input().split())
print('{}{}'.format(T, S))

### FIXED CODE ###

S, T = map(str, input().split())
print('{}{}'.format(T, S))
from scipy.misc import comb

N = int(input())
S = input()

kind = set(S)
each_char =[]

for char in kind:
    each_char.append(S.count(char))

length = len(kind)
over_stock = len(S) - len(kind)

count = 0
for i in range(over_stock + 1):
    count += (2 ** (length - i)) * comb(over_stock, i, exact=True) % (10 ** 9 + 7)

print((count - 1) % (10 ** 9 + 7))

### FIXED CODE ###

N = int(input())
S = input()

mod = 10 ** 9 + 7

kind = set(S)
each_char = []

for char in kind:
    each_char.append(S.count(char))

count = 1
for i in each_char:
    count = (count % mod) * ((i + 1) % mod) % mod

print((count - 1) % mod)
N,M = map(int,input().split())
A = list(map(int,input().split()))

R = [A[0]%M]

for i in range(1,N):
  R.append((R[-1]+A[i])%M)

k = set(R)
dic = {i:0 for i in k}
for item in R:
  dic[item]+=1

ans = (dic[0]*(dic[0]+1))//2
for i in k:
  if i !=0 :
    ans += (dic[i]*(dic[i]-1))//2

print(ans)

### FIXED CODE ###

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

R = [A[0]%M]


for i in range(1,N):
  R.append((R[-1]+A[i])%M)



import collections
c = collections.Counter(R)


ans = 0
for key in c:
  if key == 0:
    ans += (c[key]*(c[key]+1))/2
  else:
    ans += (c[key]*(c[key]-1))/2
  



print(int(ans))
N = int(input())
a = [int(input()) for i in range(N)]
a.sort(reverse=True)
sum1 = 0
sum2 = 0
for j in range(N):
    if j%2 == 0:
        print(a[j])
        sum1 = sum1 + a[j]
    elif j%2 ==1:
        print(a[j])
        sum2 = sum2 + a[j]
print(sum1 - sum2)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum1 = 0
sum2 = 0
for j in range(N):
    if j%2 == 0:
        sum1 = sum1 + a[j]
    elif j%2 ==1:
        sum2 = sum2 + a[j]
print(sum1 - sum2)
X=int(input())
if 360%K==0:
  K=360//X
  print(K)
elif 360%K!=0:
  K=2*360//(180-X)
  print(K)

### FIXED CODE ###

X=int(input())
if 360%X==0:
  K=360//X
  print(K)
elif 360%X!=0:
  i=1
  while True:
    if (X*i)%360==0:
      break
    i+=1
  print(i)
#Union-Find木の構築
import sys
def 解():
    iN,iK,iL = [int(_) for _ in input().split()]
    aD = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]

    def buildTree(a):
        aT = [0]*(iN+1)
        for p,q in a:
            #if p > q :
            #   p,q = q,p
            thisroot = max(aT[q],aT[p],q) #試しにデカい方に合わせる
            if p <= aT[q] < thisroot:  #2個づつ来るからこんなんでいいだろ
                aT[aT[q]] = thisroot
            if p <= aT[p] < thisroot:
                aT[aT[p]] = thisroot
            aT[q] = thisroot
            aT[p] = thisroot
        return aT
    def getRoot(a,i):
        if a[i] == i or a[i] == 0:
            if a[i] == 0 : a[i] = i
            return i
        elif i < a[i] :
            a[i] = getRoot(a,a[i])
            return a[i]
        else:
        #   print("! ",i,a[i])

    aT道 = buildTree(aD[0:iK])
    aT鉄道 = buildTree(aD[iK:])
    aRet = []
    dRet = {}
    for i in range(1,iN+1):
        # いやはやこんなもんもキーになるのか。
        Comb = (getRoot(aT道,i), getRoot(aT鉄道,i))
        aRet.append(Comb)
        if Comb in dRet:
            dRet[Comb] += 1
        else:
            dRet[Comb] = 1
    print(" ".join([str(dRet[_]) for _ in aRet]))

解()


### FIXED CODE ###

#Union-Find木の構築
import sys
def 解():
    iN,iK,iL = [int(_) for _ in input().split()]
    aD = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]

    def buildTree(a):
        aT = [0]*(iN+1)
        for p,q in a:
            rp = getRoot(aT,p)
            rq = getRoot(aT,q)
            thisRoot = max(rp,rq,q)
            aT[p] = thisRoot
            aT[q] = thisRoot
            aT[rp] = thisRoot #これで Union してるつもり
            aT[rq] = thisRoot
        return aT
    def getRoot(a,i): #find みんな小さい方に合わせるならデカい方に合わせてみよう
        if a[i] == i or a[i] == 0:
            if a[i] == 0 : a[i] = i
            return i
        elif i < a[i] :
            a[i] = getRoot(a,a[i])
            return a[i]
    #   else:
    #       print("! ",i,a[i])

    aT道 = buildTree(aD[0:iK])
    aT鉄道 = buildTree(aD[iK:])
    aRet = []
    dRet = {}
    for i in range(1,iN+1):
        # いやはやこんなもんもキーになるのか。
        Comb = (getRoot(aT道,i), getRoot(aT鉄道,i))
        aRet.append(Comb)
        if Comb in dRet:
            dRet[Comb] += 1
        else:
            dRet[Comb] = 1
    print(" ".join([str(dRet[_]) for _ in aRet]))

解()
D, N = list(map(int,input().split()))

n = []
for i in range(1,100):
    if D == 0:
        n.append(i)
    elif D == 1:
        n.append(100*i)
    elif D == 2:
        n.append(1000*i)
#print(n)

print(n[N-1])

### FIXED CODE ###

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

n = []
for i in range(1,1001):
    if D == 0:
        if i % 100 !=0:
            n.append(i)
        continue
    elif D == 1:
        if i % 100 !=0:
            n.append(100*i)
        continue      
    elif D == 2:
        if i % 100 !=0:
            n.append(10000*i)
        continue
print(n[N-1])
import sys

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

if k==0:
    print(max(a))
    sys.exit()

def rf(mm):
    if mm=0:
        mm=1
    icnt=0
    for i in range(n):
        icnt+=(a[i]-1)//mm+1
    return icnt

asum=sum(a)
m=asum//(n+k)
um=asum
lm=1
for ii in range(60):
    if rf(m)<=(n+k) and rf(m-1)>(n+k):
        break
    if um-lm<5:
        break
    if rf(m)>(n+k):
        lm=m
        m=int((um+lm)//2)-1
    elif rf(m)<(n+k):
        um=m
        m=int((um+lm)//2)+1
    else:
        um=m-1
        m=int((um+lm)//2)
#    if rf(m)==(n+k) and um-lm<5:

for mi in range(um,max(0,lm-1),-1):
#for mi in range(m+5,max(0,m-10),-1):
    if rf(mi)<=(n+k) and rf(mi-1)>(n+k):
#    if rf(mi)!=rf(mi-1):
        break

print(mi)



### FIXED CODE ###

import sys

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

if k==0:
    print(max(a))
    sys.exit()

def rf(mm):
    if mm==0:
        mm=1
    icnt=0
    for i in range(n):
        icnt+=(a[i]-1)//mm+1
    return icnt

asum=sum(a)
m=asum//(n+k)
um=asum
lm=1
for ii in range(60):
    if m==1:
        break
    if rf(m)<=(n+k) and rf(m-1)>(n+k):
        break
    if um-lm<5:
        break
    if rf(m)>(n+k):
        lm=m
        m=(um+lm)//2-1
    elif rf(m)<(n+k):
        um=m
        m=(um+lm)//2-1
    else:
        um=m-1
        m=(um+lm)//2-1
#    if rf(m)==(n+k) and um-lm<5:

if um<1:
    print(1)
    sys.exit()
    
for mi in range(um,max(0,lm-1),-1):
    if rf(mi)<=(n+k) and rf(mi-1)>(n+k):
        break

print(mi)
a=[]
while True:
 n = input()
  if n == 0:
   break
  a.append(n)
for i in range(len(a)):
 print(f'Case{i+1}: {a[i]}')

### FIXED CODE ###

import sys
i=1
for e in sys.stdin:
 if'0\n'==e:break
 print(f'Case {i}: {e[:-1]}');i+=1
N, M = [int(x) for x in input().split()]
s, c = [], []
ans_array = [0 for _ in range(M)]

for i in range(M):
    s_i, c_i = [int(x) for x in input().split()]
    s.append(s_i)
    c.append(c_i)

for i in range(M):
    if ans_array[s[i] - 1] == 0:
        ans_array[s[i] - 1] = c[i]
    else:
        if ans_array[s[i] - 1] != c[i]:
            print(-1)
            exit()

ans_num = int("".join([str(num) for num in ans_array]))
if ans_num == 0:
    for num in ans_array[:-1]:
        if num != 0:
            break
    print(-1)
else:
    print(ans_num)

### FIXED CODE ###

import math

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

for i in range(M):
    s_i, c_i = [int(x) for x in input().split()]
    s.append(s_i)
    c.append(c_i)

for num in range(10 ** N):
    num = str(num)
    if len(num) != N:
        continue
    for i in range(M):
        if num[s[i] - 1] != str(c[i]):
            break
    else:
        print(int(num))
        exit()

print(-1)
S=input()

if S.count('R')==0
  print(0)
if S.count('R')==1
  print(1)
if S.count('R')==2 and not moji.count('RR') ==1
  print(1)
if S.count('RR')==1
  print(2)
if S.count('RRR')==1
  print(3)
  

### FIXED CODE ###

S=str(input())
 
if S.count('R')==0:
  print(0)
if S.count('R')==1 :
  print(1)
if S.count('R')==2 and not S.count('RR') ==1:
  print(1)
if S.count('RR')==1 and not S.count('RRR')==1:
  print(2)
if S.count('RRR')==1:
  print(3)
n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: x >= m-1, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)


### FIXED CODE ###

n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] += 1

def num(s):
  return len(list(filter(lambda x: x >= s-1, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)
N = int(input())
M = int(input())

items = [i for i in input().join(' ')]
items.sort()
total = sum(items)

flag = 1
for i in range(M):
  if 1 // (4 * M) >= items[i]:
    pass
  else:
    flag = 0
if not flag:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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

items = [int(i) for i in input().split()]
items.sort(reverse=True)
total = sum(items)

flag = 1
for i in range(M):
  if total / (4 * M) <= items[i]:
    pass
  else:
    flag = 0
if flag:
  print('Yes')
else:
  print('No')
import math
N,M = map(int,input().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N == 0:
  ans = combinations_count(M, 2)
elif M == 0:
  ans = combinations_count(N, 2)
elif N == 0 and M == 0:
  ans = 0
else:
  ans = combinations_count(N, 2) +  combinations_count(M, 2)
print(ans)

### FIXED CODE ###

import math
N,M = map(int,input().split())
ans = N*(N-1)/2 + M*(M-1)/2
print( int(ans) )
a_1, a_2, a_3 = map(int, input().split())
a = [a_1, a_2, a_3]

ad = sorted(a, reverse=True)
ans = (ad[0]-ad[1] + (ad[1]-ad[2])
print(ans)

### FIXED CODE ###

a_1, a_2, a_3 = map(int, input().split())

maxs = max(a_1, a_2, a_3)
mins = min(a_1, a_2, a_3)
ans = maxs-mins
print(ans)
N, C = map(int, input().split())
query = [list(map(int, input().split())) for _ in range(N)]
time = [0 for _ in range(2 * 10 ** 5)]
for q in query:
    s, t = q[:2]
    for i in range(2 * s - 1, 2 * t + 1):
        time[i] += 1
print(max(time))

### FIXED CODE ###

N, C = map(int, input().split())
query = [list(map(int, input().split())) for _ in range(N)]
timeTable = [[False for _ in range(10 ** 5)] for _ in range(C)]
time = [0 for _ in range(10 ** 6)]
for q in query:
    s, t, c = q
    for i in range(s - 1, t):
        timeTable[c - 1][i] = True
for channel in timeTable:
    for i in range(10 ** 5):
        if channel[i]:
            time[2 * i - 1] += 1
            time[2 * i] += 1
print(max(time))
N, *A = map(int, open(0).read().split())

E = [[] for _ in range(N + 1)]
for i, v in enumerate(A, 1):
    E[v - 1].append(i)

def dfs(v):
    D = sorted(dfs(u) for u in E[v])
    return max([0] + [len(D) - i + d for i, d in enumerate(D)])

print(dfs(0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

N, *A = map(int, open(0))

E = [[] for _ in [0] + A]
for i, v in enumerate(A, 1):
    E[v - 1] += i,

def dfs(v):
    D = sorted(map(dfs, E[v]))
    l = len(D)
    return max([0] + [l - i + d for i, d in enumerate(D)])

print(dfs(0))
from collections import Counter
import math

NN = int(input())
c = Counter()
# create sieve
#MAXLEN = math.ceil(math.sqrt(N+1))+1
#sv = [False] * (MAXLEN+1)
#pr = list()
#for i in range(2, MAXLEN+1):
#    if sv[i]: continue
#    pr.append(i)
#    for j in range(i, MAXLEN+1, i):
#        sv[j] = True
#if N!=1: pr.append(N)
N = NN
for i in range(2, math.ceil(math.sqrt(N)+1)+1):
    while N%i == 0:
        c.update([i])
        N = N // i
if N!=1: c.update([N])
            
def R(n):
    ret = 0
    for i in range(1, n+1):
        if n>=i:
            ret += 1
            n -= i
        else:
            break
    return ret
 
ans = 0
for n in c:
    ans += R(c[n])
print(ans)


### FIXED CODE ###

from collections import Counter
import math

N = int(input())
c = Counter()

for i in range(2, math.ceil(math.sqrt(N)+1)+1):
    while N%i == 0:
        c.update([i])
        N = N // i
if N!=1: c.update([N])
            
def R(n):
    ret = 0
    for i in range(1, n+1):
        if n>=i:
            ret += 1
            n -= i
        else:
            break
    return ret
 
ans = 0
for n in c:
    ans += R(c[n])
print(ans)
n, a = map(int, input().split())

if n % 500:
  if (n % 500) <= a:
    print("Yes")
  else:
    print("No")
else:
    print("Yes")


### FIXED CODE ###

n = int(input())
a = int(input())

if n % 500:
  if (n % 500) <= a:
    print("Yes")
  else:
    print("No")
else:
    print("Yes")
a1, a2, a3 = int(input().split())

if (a1 + a2 + a3 <= 21):
    print('win')
else:
    print('bust')

### FIXED CODE ###

a1, a2, a3 = map(int, input().split())

if (a1 + a2 + a3 <= 21):
    print('win')
else:
    print('bust')
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = [int(i) for i in input().split()]

    MOD = 10 ** 9 + 7
    A.sort()
    s = set()

    ans = 0
    if A[0] != A[1]:
        ans += 1

    for i in range(1, n):
        if A[i - 1] == A[i]:
            continue

        for j in range(i):
            if A[j] in s:
                continue
            elif A[i] % A[j] == 0:
                s.add(i)
                break
        else:
            ans += 1
            # print(f"{i = }, {j = }, {ans = }")

    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import numpy as np
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = np.array([int(i) for i in input().split()])

    max_dp = np.max(A) + 1
    dp = np.zeros(max_dp, dtype="int32")

    for a in A:
        if dp[a] >= 2:
            continue
        fancy = np.arange(a, max_dp, a)
        dp[fancy] += 2
        dp[a] -= 1
    print(np.sum(dp == 1))


if __name__ == '__main__':
    main()
from collections import deque

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

nodes = [ [] for i in range(m+1)]

# グラフ生成
for i in range(1, m + 1):
    a, b = map(int, input().split())
    nodes[a].append(b)
    nodes[b].append(a)

ans = [0] * (n+1)

# キュー作成
stk = deque([1])

# BFS 幅優先探索
while stk:
    v = stk.pop()
    for s in nodes[v]:
        # 未到達ノードであれば、キューに追加
        if ans[s] == 0:
            # ひとつ前のノードを記録
            ans[s] = v
            # キューに要素を追加
            stk.appendleft(s)

ans = ans[2:]
 
if 0 in ans:
    print("No")
else:
    print("Yes")
    for i in ans:
        print(i)

### FIXED CODE ###

from collections import deque

n, m = map(int, input().split())
G = [[]for i in range(n+1)]

# グラフ生成
for i in range(m):
    a, b = map(int, input().split())
    G[a].append(b)
    G[b].append(a)
 
ans = [0]*(n+1)
 
stk = deque([1])
 
# BFS 幅優先探索
while stk:
    v = stk.pop()
    for s in G[v]:
        # 未到達ノードであれば、キューに追加
        if ans[s] == 0:
            ans[s] = v
            stk.appendleft(s)
ans = ans[2:]
 
if 0 in ans:
    print("No")
else:
    print("Yes")
    for i in ans:
        print(i)
N = int(input())
a = [int(input()) for i in range(N)]

a.sort()
ans = sum(a)
for i in range(len(a)):
    if ans % 10 == 0:
        ans = ans - a[i]
print (ans)


### FIXED CODE ###

l = list(map(int,input().split()))
if l[0] + l[1] < 10:
    print(l[0] + l[1])
else:
    print('error')
#https://atcoder.jp/contests/abc077/tasks/arc084_a
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
a.sort()
b.sort()
c.sort()
ai = 0
ci = 0
for bi in b:
    while ai < N and a[ai] < bi:
        ai += 1
    while ci >= 0 and c[ci] <= bi:
        ci += 1
    ans += ai * (N -ci)
print(ans)


### FIXED CODE ###

#https://atcoder.jp/contests/abc077/tasks/arc084_a
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
a.sort()
b.sort()
c.sort()
ai = 0
ci = 0
for bi in b:
    while ai < N and a[ai] < bi:
        ai += 1
    while ci < N and c[ci] <= bi:
        ci += 1
    ans += ai * (N -ci)
print(ans)
import math

num = [input() for _ in range(5)]
num2 = sorted([list(i)[-1] for i in num],reverse = False)

num3 = [n for n in num2 if n != "0" ]



C = 0
c = 1

for i in num:
	j = list(i)[-1]
  
	if j == num3[0] and c == 1:
		C += int(i)
		c += 1
	elif c>1:
		if int(j) >= 5 or int(j) == 0:
			C += round(int(i),-1)
			#print(round(C))
			
                  
		elif 0< int(j) < 5:
			C += round(int(i),-1)+10		
        
        
	else:
		if int(j) >= 5 or int(j) == 0:
			C += round(int(i),-1)
			#print(round(C))
			
                  
		elif 0< int(j) < 5:
			C += round(int(i),-1)+10	
		#	print(round(C))


print(C)

### FIXED CODE ###

num = [int(input()) for _ in range(5)]
num2 = [n if n % 10 == 0 else n - (n%10) + 10  for n in num]

c = []
for i, j  in enumerate(num):
    n = j
    for k,l in enumerate(num2):
        if  k == i:
            continue
        else:
            n += l
    c.append(n)

print(int(min(c)))
N, A = map(int, input().split())
x = [int(x) for x in input().split()]

max_x = max(x)
dp = [[[0 for _ in range((N + 1) * max_x)] for _ in range(N + 1)] for _ in range(N + 1)]
dp[0][0][0] = 1

for j in range(1, N + 1):
    for k in range(N + 1):
        for s in range((N + 1) * max_x):
            if s < x[j - 1]:
                dp[j][k][s] = dp[j - 1][k][s]
            elif k >= 1 and s >= x[j - 1]:
                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j - 1]]

ans = 0
for k in range(1, N + 1):
    ans += dp[N][k][k * A]
print(ans)


### FIXED CODE ###

from itertools import product

N, A = map(int, input().split())
x = [int(x) for x in input().split()]

X = max(max(x), A)
dp = [[0 for _ in range(2 * N * X + 1)] for _ in range(N + 1)]
dp[0][N * X] = 1

for j, t in product(range(1, N + 1), range(2 * N * X + 1)):
    y = x[j - 1] - A
    if t - y < 0 or t - y > 2 * N * X:
        dp[j][t] = dp[j - 1][t]
    elif 0 <= t - y <= 2 * N * X:
        dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y]
print(dp[N][N * X] - 1)
O = input()
E = input()

ans = ''
for i in range(len(O)+len(E)):
  if i%2 == 0:
    ans+=O[i/2]
  else:
    ans+=E[i/2]
print(ans)

### FIXED CODE ###

O = input()
E = input()

ans = ''
for i in range(len(O)+len(E)):
  if i%2 == 0:
    ans+=O[int(i/2)]
  else:
    ans+=E[int(i/2)]
print(ans)
A=list(map(int,input()split()))
B=0
B=A[0]+A[1]+A[2]
if B>=22:
    print("bust")
else:
    print("win")

### FIXED CODE ###

A=list(map(int,input().split()))
B=0
B=A[0]+A[1]+A[2]
if B>=22:
    print("bust")
else:
    print("win")
S = input()
N = len(str(S))
temp = S[0:(N-1)/2]
temp2 = S[(N+2)/2:N]
print("Yes") if temp == temp[::-1] and temp2 == temp2[::-1] else "No"

### FIXED CODE ###

s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

if flag:
    print("Yes")
else:
    print("No")
A, B = input().split()

C = A * B
print(C)

### FIXED CODE ###

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

c = a * b
print(c)
import math

n= int(input())

m = math.floor(n/2)
q = int( n / m )
lm= m

s = n - 1
while( m!=1 ):
    m = math.floor(n/(q+1))
    r0 = n % ( m + 1 )
    if r0>=q:
        d= r0  - q
        if d%q==0:
            s+= ( m+1+int(d/q) )
    #
    # for next
    q = int( n/m )
    lm= m
#
print( s )


### FIXED CODE ###

import math
n= int(input())

m = math.floor(n/2)
if n>2:
    q = int( n / m )
    lm= m
    s = n - 1
else:
    s = 0

while( m>1 ):
    m = math.floor(n/(q+1))
    r0 = n % ( m + 1 )
    if r0>=q:
        d= r0  - q
        if d%q==0:
            s+= ( m+1+int(d/q) )
    #
    # for next
    q = int( n/m )
    lm= m
#
print( s )
from numpy import*
z=loadtxt(open(0),int,skiprows=1)
r=zeros(9**6,int)
c=copy(r)
for y,x in z:r[y]+=1;c[x]+=1
h,w=max(r),max(c)
y,x=z.T
print(h+w-(sum(r==h)*sum(w==c)==sum(h+w==r[y]+c[x])))

### FIXED CODE ###

from collections import*
(h,w,m),*z=[tuple(map(int,o.split()))for o in open(0)]
s=set(z)
y,x=[Counter(t).most_common()for t in zip(*z)]
a,b=y[0][1],x[0][1]
p=[i for i,v in y if v==a]
q=[i for i,v in x if v==b]
for i in p:
  for j in q:
    if(i,j)not in s:exit(print(a+b))
print(a+b-1)