Harryxun/stf_run huggingface dataset:
import sys
n, *lst = map(int, sys.stdin.read().split())
res = sum(lst)
if not res % 10:
  tmp = [i if not i % 10 for i in lst]
  if tmp:
    res -= min(tmp)
  else:
    res = 0
print(res)
  

### FIXED CODE ###

import sys
n, *lst = map(int, sys.stdin.read().split())
res = sum(lst)
if not res % 10:
  tmp = [i for i in lst if i % 10]
  if tmp:
    res -= min(tmp)
  else:
    res = 0
print(res)
#!usr/bim/python
#! -*- coding: utf-8 -*-

import numpy as np

n = raw_input()
n = int(n)

tree = np.zeros([n,n],dtype=np.int64)
for i in range(n-1):
    abc = raw_input()
    abc = abc.split()
    abc = map(int, abc)
    tree[abc[0]-1,abc[1]-1] = abc[2]
    tree[abc[1]-1,abc[0]-1] = abc[2]

qk = raw_input()
qk = qk.split()
q,k = map(int,qk)

question = []
for i in range(q):
    xy = raw_input()
    xy = xy.split()
    xy = map(int,xy)
    question.append(xy)

distance = []
for i in range(n):
    distance.append(-1)

distance[k-1] = 0

while 1:
    status = 0
    for i in range(len(distance)):
        if distance[i] == -1:
            status = 1
        else:
            for j in range(n):
                if tree[i][j] == 0:
                    pass
                elif distance[j] == -1:
                    distance[j] = distance[i] + tree[i][j]
    if status == 0:
        break

for line in question:
    ans = distance[line[0]-1] + distance[line[1]-1]
    print ans


### FIXED CODE ###

#!usr/bim/python
#! -*- coding: utf-8 -*-

import numpy as np

n = raw_input()
n = int(n)

tree = []
for i in range(n):
    tree.append([])

for i in range(n-1):
    abc = raw_input()
    abc = abc.split()
    abc = map(int, abc)
    tree[abc[0]-1].append([abc[1]-1,abc[2]])
    tree[abc[1]-1].append([abc[0]-1,abc[2]])


qk = raw_input()
qk = qk.split()
q,k = map(int,qk)

question = []
for i in range(q):
    xy = raw_input()
    xy = xy.split()
    xy = map(int,xy)
    question.append(xy)

distance = []
for i in range(n):
    distance.append(-1)

distance[k-1] = 0

next_point = [k-1]

while 1:
    search_point = next_point
    next_point = []
    if len(search_point) == 0:
        break
    else:
        for i in search_point:
            for j in tree[i]:
                if distance[j[0]] == -1:
                    distance[j[0]] = distance[i] + j[1]
                    next_point.append(j[0])

for line in question:
    print distance[line[0]-1] + distance[line[1]-1]
#coding:UTF-8

a = []
a,b,c = map(int,raw_input().split())
for i in range(a,b):
    if c % i == 0
    n += 1
print n

### FIXED CODE ###

#coding:UTF-8

n = 0
a,b,c = map(int,raw_input().split())
for i in range(a,b+1):
    if c % i == 0:
        n += 1
print n
import math
    from functools import reduce
     
    def lcm_base(x, y):
        return (x * y) // math.gcd(x, y)
     
    def lcm_list(numbers):
        return reduce(lcm_base, numbers, 1)
      
    N = int(input())
    A = list(map(int,input().split()))
    ans = 0
     
    lcm = lcm_list(A)
     
    for i in range(N):
      ans += lcm//A[i]
     
    print(ans%1000000007)

### FIXED CODE ###

import math
from functools import reduce
     
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
     
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
      
N = int(input())
A = list(map(int,input().split()))
ans = 0
     
lcm = lcm_list(A)
     
for i in range(N):
    ans += lcm//A[i]
     
print(ans%1000000007)
def main():
    from sys import stdin
    import pandas as pd
    readline = stdin.readline

    n = int(readline())
    S = pd.Series([readline()[:-1] for _ in [0]*n])

    S = S.value_counts().copy()
    cond = S[0]
    answers = list(S[S == cond].sort_index().index)

    for ans in answers:
        print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    from sys import stdin
    from collections import Counter
    readline = stdin.readline

    n = int(readline())
    S = [readline()[:-1] for _ in [0]*n]

    s = Counter(S)
    most = s.most_common(1)[0][1]

    answers = [i[0] for i in s.items() if i[1] == most]
    answers = sorted(answers)

    for ans in answers:
        print(ans)


if __name__ == '__main__':
    main()
N = int(input())
arr = list(map(int, input(),split()))

ans = []

for idx1 in range(1, N+1):
	for idx2 in range(len(arr), 1, -1):
    	if arr[idx2-1] == idx2:
    		ans.append(arr.pop(idx2-1))
            break
    	elif idx1 == 1:
    		exit(-1)

for idx in range(0, N)
	print(ans.pop(-1))
  	print("\n")

### FIXED CODE ###

N = int(input())
arr = list(map(int, input().split()))
 
ans = []
 
for idx1 in range(1, N+1):
	for idx2 in range(len(arr), 0, -1):
		if arr[idx2-1] == idx2:
			tmp = arr.pop(idx2-1)
			ans.append(tmp)
			break
		elif idx2 == 1:
			print(-1)
			exit()

for idx in range(0, N):
	tmp = ans.pop(-1)
	print(tmp)
import sys
sys.setrecursionlimit(1000000)

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

li2 = []
for i in range(1, len(li1)):
    li2.append(li1[i-1] - li1[i])
    
cnt1 = 0
cnt2 = 0
li3 = []

for i in li2:
    cnt2 += 1
    if i < 0:
        li3.append(cnt1)
        cnt1 = 0
    else:
        cnt1 += 1
    if cnt2 == len(li2):
        li3.append(cnt1)

print(max(li3))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

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

li2 = []
for i in range(1, len(li1)):
    li2.append(li1[i-1] - li1[i])
    
cnt1 = 0
cnt2 = 0
li3 = []

for i in li2:
    cnt2 += 1
    if i < 0:
        li3.append(cnt1)
        cnt1 = 0
    else:
        cnt1 += 1

li3.append(cnt1)

print(max(li3))
import math

r = int(input())
pi = math.pi

area = ('%03.6f' % (r * r * pi))
length = ('%03.6f' % (2 * r * pi))

print(area, length, sep=" ")

### FIXED CODE ###

import math
r = float(input())

area = math.pi * r**2
length = 2 * r * math.pi

print("{:.6f} {:.6f}".format(area, length))
#n=int(input())
n,m=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(q)]
b=(n-1)//2
a=b//2
ll=[[0,0]for i in range(b)]
ll[0]=[1,2]

if b//2==b/2:
    for i in range(1,b):
        if i//2!=i/2:
            ll[i]=[2+a-(i//2),2+a-(i//2)+i+1]
        else:
            if i==b-2:
                ll[i]=[3+b//2,3+b//2+b-2+1]
            else:
                ll[i]=[3+b//2+b-2+1-i//2,3+b//2+b-2+1-i//2+i+1]
else:
    for i in range(1,b):
        if i//2==i/2:
            ll[i]=[3+b//2-i//2,3+b//2-i//2+i+1]
        else:
            if i==b-2:
                ll[i]=[3+b//2+1,3+b//2+b-1+1]
            else:
                ll[i]=[3+b//2+b-1+1-(i+1)//2,3+b//2+b-1+1-(i+1)//2+i+1]            

for i in range(m):
    print(*ll[i])
    

### FIXED CODE ###

#n=int(input())
a,b,n=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(q)]

#for i in range(n+1):
#    print(i,(a*i/b)//1,a*((i/b)//1),(a*i/b)//1-a*((i/b)//1))
i=min(b-1,n)
print(int((a*i/b)//1-a*((i/b)//1)))
n = int(input())
links = {u: {} for u in range(1, n + 1)}
for i in range(n - 1):
	x, y, z = map(int, input().split())
	links[x][y] = z
	links[y][x] = z
vis = [0] * (n + 1)
col = [0] * (n + 1)

def dfs(u, c):
	vis[u] = 1
	col[u] = c
	for v, l in links[u].items():
		# print("%d, %d" % (v, l))
		if vis[v] == 0:
			if l & 1:
				dfs(v, c ^ 1)
			else:
				dfs(v, c)

dfs(1, 0)

for u in range(1, n + 1):
	print(col[u])

### FIXED CODE ###

n = int(input())
links = {u: {} for u in range(1, n + 1)}
for i in range(n - 1):
	x, y, z = map(int, input().split())
	links[x][y] = z
	links[y][x] = z
vis = [0] * (n + 1)
col = [0] * (n + 1)

now = 0
q = [(1, 0)]
while now < len(q):
	u = q[now][0]
	c = q[now][1]
	now += 1
	vis[u] = 1
	col[u] = c
	for v, l in links[u].items():
		if vis[v] == 0:
			if l & 1:
				q.append((v, c ^ 1))
			else:
				q.append((v, c))

for u in range(1, n + 1):
	print(col[u])
import fractions
A,B,C,D = map(int,input().split())

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

CD = lcm(C,D)
c_div = 0
d_div = 0
cd_div = 0
ans = 0

if A % C == 0:
    first_C = A
else:
    first_C = A + C -(A%C)
last_C = B -(B%C)
c_div = (last_C - first_C)//C + 1

if A % D == 0:
    first_D = A
else:
    first_D = A + D -(A%D)
    last_D = B - (B%D)
d_div = (last_D - first_D)//D + 1

if A % CD == 0:
    first_CD =A
else:
    first_CD = A + CD -(A%CD)
    last_CD = B -(B%CD)
cd_div = (last_CD - first_CD)//CD + 1

ans = c_div + d_div -cd_div
print(B-A+1-ans)


### FIXED CODE ###

A,B,C,D = map(int,input().split())
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(a, b):
    return a * b // gcd (a, b)
CD = lcm(C,D)
c_div = 0
d_div = 0
cd_div = 0
ans = 0
if A % C == 0:
    first_C = A
else:
    first_C = A + C -(A%C)
last_C = B -(B%C)
c_div = (last_C - first_C)//C + 1

if A % D == 0:
    first_D = A
else:
    first_D = A + D -(A%D)
last_D = B - (B%D)
d_div = (last_D - first_D)//D + 1

if A % CD == 0:
    first_CD =A
else:
    first_CD = A + CD -(A%CD)
last_CD = B -(B%CD)
cd_div = (last_CD - first_CD)//CD + 1

ans = c_div + d_div -cd_div
print(B-A+1-ans)
import re
s=str(input())
t=str(input())
t2=re.sub(s,"",t)
if len(t2)=1:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import re
s=str(input())
t=str(input())
for i in range(len(s)):
 if s[i]!=t[i]:
  print("No")
  exit()
 else:
  pass
if re.sub(r"[a-z]","",t)=="":
  print("Yes")
else:
  print("No")
N=int(input())
a=[0]*N
b=[0]*N
for i in range(N):
  a[i]=float(input().split())
  b[i]=input().split
total=0
for j in range(N):
  if b[j]='JPY':
    total = total+ a[j]
  else:
    total = total+380000.0*a[j]
print(total)


### FIXED CODE ###

N=int(input())
a=[]
b=[]
for i in range(N):
  x,y=input().split()
  a.append(float(x))
  b.append(y)
total=0
for j in range(N):
  if b[j]=='JPY':
    total += a[j]
  else:
    total += 380000.0*a[j]
print(total)
S, T = input().split()
A, B = map(int, input().split())
U = input()
if S == U:
    A -= 1
else:
    B -= 1
print(f'{A} {B}')

### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()
if S == U:
    A -= 1
else:
    B -= 1
print('{} {}'.format(A, B))
N= int(input())
A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
ans=[]

if N==1:
    print(A1[0]+A2[0])
else:
    for i in range(N):
        ansA1=0
        ansA2=0
        for j in range(i):
            ansA1+=A1[j]
        for k in range(j,N):
            ansA2+=A2[k]
        ans1=ansA1+ansA2
        ans.append(ans1)

print(max(ans))

### FIXED CODE ###

N = int(input())
a = [list(map(int,input().split())) for i in range(2)]
b = []
for i in range(0,N):
    s = 0
    v = 0
    for j in range(0,i+1):
        s += a[0][j]
    for j in range(i,N):
        v += a[1][j]
    b.append(s+v)
print(max(b))
import numpy as np

N = int(input())
tmp = input().split(' ')

A = []
for i in range(N):
    A.append(int(tmp[i]))

A = np.asarray(A)
print(A.max() - A.min())

### FIXED CODE ###

N = int(input())
if N % 2 == 0:
    print(N)
else:
    print(N * 2)
n=int(input())
a=[map(int,input().split())]

for A in a:
    cnt=0
    while A%2==0:
        A=A//2
        cnt=cnt+1

print(cnt)


### FIXED CODE ###

ans=10**9
n=int(input())
a=list(map(int,input().split()))

for A in a:
    cnt=0
    while A % 2==0: 
        A//=2
        cnt+=1
      
    if cnt<ans:
        ans=cnt
print(ans)
import bisect
import sys
input = sys.stdin.readline

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

tree = [[] for _ in range(n)]
for _ in range(n - 1):
    u, v = map(int, input().split())
    tree[u - 1].append(v - 1)
    tree[v - 1].append(u - 1)

ans = [0] * n
visited = [0] * n
visited[0] = 1


def dfs(i, l):
    s = a[i]
    if len(l) == 0 or s > l[-1]:
        l.append(s)
    else:
        l[bisect.bisect_left(l, s)] = s
    ans[i] = len(l)

    for ni in tree[i]:
        if not visited[ni]:
            visited[ni] = 1
            dfs(ni, l[:])


dfs(0, [])

for i in ans:
    print(i)


### FIXED CODE ###

import bisect
import sys
sys.setrecursionlimit(1000000)

input = sys.stdin.readline

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

tree = [[] for _ in range(n)]
for _ in range(n - 1):
    u, v = map(int, input().split())
    tree[u - 1].append(v - 1)
    tree[v - 1].append(u - 1)

ans = [0] * n
visited = [0] * n
visited[0] = 1
l = []

def dfs(i):
    s = a[i]
    pi = -1
    pv = -1
    if len(l) == 0 or s > l[-1]:
        l.append(s)
    else:
        pi = bisect.bisect_left(l, s)
        pv = l[pi]
        l[pi] = s
    ans[i] = len(l)

    for ni in tree[i]:
        if not visited[ni]:
            visited[ni] = 1
            dfs(ni)
            
    if pi == -1:
        l.pop()
    else:
        l[pi] = pv


dfs(0)

for i in ans:
    print(i)
N = int(input())
A = list(map(int, input().split()))

S = sorted(set(A))

ans = 0
n = len(S)
if n == 1:
    ans = 0
else:
    ans = 1
    for i in range(1, N):
        j = 0
        while S[i] % S[j] > 0:
            j += 1
            if i <= j:
                ans += 1
                break
print(ans)

### FIXED CODE ###

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

MAX = 10 ** 6

A.sort()
s = set()
ans = N
for i in range(N):
    a = A[i]
    if a in s:
        ans -= 1
        continue
    if i < N - 1 and A[i + 1] == a:
        ans -= 1
    n = MAX // a
    for i in range(1, n + 1):
        s.add(a * i)
print(ans)
n = int(input())
tree = [[] for i in range(n)]
d_list = [-1]*n
d_list[0] = 0
stack = []
for i in range(n):
  u,v,w = map(int,input().split())
  tree[u-1].append((u-1,v-1,w))
for e in tree[0]:
  stack.append(e)
while len(stack) > 0:
  u,v, w = stack.pop()
  d_list[v] = d_list[u]+w
  for e in tree[v]:
    stack.append(e)
    
for v in d_list:
  if v % 2 == 0:
    print(0)
  else:
    print(1)

### FIXED CODE ###

n = int(input())
tree = [[] for i in range(n)]
d_list = [0]*n

stack = []
for i in range(n-1):
  u,v,w = map(int,input().split())
  tree[u-1].append((u-1,v-1,w))
  tree[v-1].append((v-1,u-1,w))
while len(tree[0]) > 0:
  e = tree[0].pop()
  stack.append(e)
#print(stack)
while len(stack) > 0:
  u,v, w = stack.pop()
  if d_list[v] == 0:
    d_list[v] = d_list[u]+w
  while len(tree[v]) > 0:
    e = tree[v].pop()
    stack.append(e)
  #print(stack)
for v in d_list:
  if v % 2 == 0:
    print(0)
  else:
    print(1)
>>>  A,B=input().strip().split()
if A>B:print(">") if A=B:print("=") if A<B:print("<")


### FIXED CODE ###

a,b=input().split()
x,y=ord(a),ord(b)

if x > y:
    print(">")
elif x==y:
  print("=")
else:
  print("<")
import io,sys
sys.setrecursionlimit(10**6)

def prime(n):
    nums = [True]*n
    primes = []
    for i in range(2,n):
        if nums[i]:
            primes.append(i)
            for j in range(2*i,n,i):
                nums[j] = False
    return primes

def main():
    from collections import Counter
    from collections import deque
    import bisect
    n = int(input())
    num = Counter([])

    primes = prime(int(n**0.5+1))+[n]
    primes = deque(primes)

    while n !=1:
        while len(primes)>0:
            p = primes.popleft()
            if len(primes)>0:
                q = primes.pop()
            else:
                q=10**10
            if n%p==0:
                num[p]+=1
                n = n//p
                primes.appendleft(p)
                break
            elif n%q==0:
                num[q]+=1
                n = n//q
                primes.append(q)
                break

    m = max(num.values())
    N = [i*(i+1)//2 for i in range(1,int((2*m)**0.5)+1)]
    ans = 0
    for i in num.values():
        k = bisect.bisect_right(N,i)
        ans+=k
    print(ans)
main()

### FIXED CODE ###

def prime(n):
    nums = [True]*n
    primes = []
    for i in range(2,n):
        if nums[i]:
            primes.append(i)
            for j in range(2*i,n,i):
                nums[j] = False
    return primes

def prime_fac(n):
    fac = {}
    primes = prime(int(n**0.5)+1)
    for p in primes:
        while n%p==0:
            fac[p] = fac.get(p,0)+1
            n//=p
    if n > 1:
        fac[n] = 1
    return fac

def main():
    n = int(input())
    fac = prime_fac(n)

    ans = 0
    for i in fac.values():
        ct = 1
        while i >= ct*(ct+1)//2:
            ct += 1
            ans+=1
    print(ans)
main()
N = int(input())
flag = False
for i in range(N//4 +1):
  for j in range(N//7 +1):
	if 4*i + 7*j == N:
	  print("Yes")
      flag = True
	  break

if flag:
  break
else:
  print("No")

### FIXED CODE ###

N = int(input())
fmax = int(N/4)+1
smax = int(N/7)+1
for i in range(fmax+1):
  for j in range(smax+1):
    if (4*i+7*j) == N:
      print('Yes')
      exit()
print('No')
import sys

a = sys.stdin.readline().split(' ')
data = sys.stdin.readlines()

S = int(a[0])
H = int(a[1])

dx = [0,1,0,-1]
dy = [1,0,-1,0]

ans = 'Yes'
if S == 1 and H == 1:
    continue
else:
    for i in range(S):
        for j in range(H):
            if data[i][j] == '.':
                continue
            else:
                for k in range(4):
                    x = j + dx[k]
                    y = i + dy[k]
                    if x < 0 or y < 0 or x >= H or y >= S:
                        continue
                    else:
                        if data[y][x] == "#":
                            ans = 'Yes'
                            break
                        else:
                            ans = 'No'
                            continue

print(ans)



### FIXED CODE ###

import sys

a = sys.stdin.readline().split(' ')
data = sys.stdin.readlines()

S = int(a[0])
H = int(a[1])

dx = [0,1,0,-1]
dy = [1,0,-1,0]

for i in range(S):
    for j in range(H):
        count = 0
        if data[i][j] == '#':
            for k in range(4):
                x = j + dx[k]
                y = i + dy[k]
                if x < 0 or y < 0 or x >= H or y >= S:
                    continue
                else:
                    if data[y][x] == "#":
                        count = count+1
            if count == 0:
                print('No')
                sys.exit()


print('Yes')
import math
n = int(input())
c_t = 0
c_a = 0
for i in range(n):
    t, a = [int(x) for x in input().split(" ")]
    #print(min(c_t / t, c_a / a))
    init = int(math.floor(max(c_t / t, c_a / a, 1)))
    for j in range(init,10**18):
        if t*j >= c_t and a*j >= c_a:
            c_t = t*j
            c_a = a*j
            #print("->" + str(j))
            break
print(c_t + c_a)


### FIXED CODE ###

lst = [x for x in input().split(" ")]
s = set(lst)
print(len(s))
while True:
	a, b = map(int, input().split())
	print(len(str(a + b)))

### FIXED CODE ###

while True:
	try:
		a, b = map(int, input().split())
		print(len(str(a + b)))
	except EOFError:
		break
n,q = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n-1)]
px = [list(map(int,input().split())) for _ in range(q)]

dic = {i+1:[] for i in range(n)}
for a,b in ab:
  dic[a].append(b)
  
vs=[0]*n

def plus(v,p):
  vs[v-1]+=p
  for nv in dic[v]:
    plus(nv,p)  

for p,x in px:    
  plus(p,x)    

print(' '.join(map(str,vs)))

### FIXED CODE ###

from collections import deque

n,q = map(int,input().split())
cnt = [0]*(n+1)
g=[[] for _ in range(n+1)]

for _ in range(n-1):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
  
for _ in range(q): 
  v,val=map(int,input().split())
  cnt[v]+=val    
  
q = deque()
q.append(1)
checked = [0]*(n+1) 
while q:
  v = q.pop()
  checked[v] = 1
  for vc in g[v]:
    if checked[vc] == 1:
      continue
    else:
      cnt[vc] += cnt[v]
      q.append(vc)
    
print(*cnt[1:])
I=lambda:[int(i) for i in input().split()]
h,w,d=I()
p=[[-1,-1] for i in range(h*w+1) ]
a=[]
for i in range(h):
  a.append(I())
  for j in range(w):
    p[a[i][j]]=[i,j]

import sys
sys.setrecursionlimit(100000)
from functools import lru_cache

@lru_cache(maxsize=100000)
def dist_d(s,g,d):
  if s==g:
    return 0
  else:
    y0,x0=p[s]
    s = a[y0][x0]+d
    y,x = p[s]
    return abs(x-x0)+abs(y-y0) + dist_d(s,g,d)
  
for i in range(int(input())):
  s,g=I()
  print(dist_d(s,g,d))


### FIXED CODE ###

I=lambda:map(int,input().split())
h,w,d=I()
H={}
W={}
for i in range(1,h+1):
  for j,k in enumerate(I(),1):
    H[k],W[k]=i,j
x=1+h*w
s=[0 for _ in range(x)]
for i in range(d+1,x):
  s[i]=s[i-d]+abs(H[i]-H[i-d])+abs(W[i]-W[i-d])

for _ in range(int(input())):
  a,b=I()
  print(s[b]-s[a])
A,B=map(in,input().split());print(A+B if A+B<10 else "error")

### FIXED CODE ###

A,B=map(int,input().split());print(A+B if A+B<10 else "error")
import sys
import numpy as np
sys.setrecursionlimit(10**7)
def input(): return sys.stdin.readline().rstrip()


def main():
    H, W, M = map(int, input().split())
    mm = []
    l = np.zeros((H, W))
    for i in range(M):
        a, b = map(int, input().split())
        mm.append([a, b])
        l[a-1][b-1] = 1
    row_max = 0
    row_num = 0
    col_max = 0
    col_num = 0

    r = np.count_nonzero(l == 1, axis=1)
    row_max = max(r)
    row_num = np.argmax(r)

    c = np.count_nonzero(l == 1, axis=0)
    col_max = max(c)
    col_num = np.argmax(c)

    a = np.count_nonzero(c == col_max)
    if [row_num+1, col_num+1] in mm:
        print(row_max + col_max - 1)
    else:
        print(row_max + col_max)
        
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
def input(): return sys.stdin.readline().rstrip()


def main():
    H, W, M = map(int, input().split())
    bombs = []
    hs = [0] * H
    ws = [0] * W
    for _ in range(M):
        h, w = map(int, input().split())
        bombs.append(tuple([h-1, w-1]))
        hs[h-1] += 1
        ws[w-1] += 1
    maxh = max(hs)
    maxw = max(ws)
    ans = maxh + maxw

    maxhindex = [i for i, x in enumerate(hs) if x == maxh]
    maxwindex = [i for i, x in enumerate(ws) if x == maxw]

    bombs = set(bombs)
    for i in maxhindex:
        for j in maxwindex:
            if (i, j) not in bombs:
                print(ans)
                exit()
    print(ans-1)


if __name__ == '__main__':
    main()
N,Q = [int(w) for w in input().split()]
i = 0
x = []
y = []
cile i < N:
    a,b = [int(w) for w in input().split()]
    x.append(a)
    y.append(b)
    i +=1
for i in range(N):
    m = (x[i]**2 + y[i]**2)**(1/2)
    if  m <= Q:
        count += 1
    else:
        count += 0
print(count)ount = 0

### FIXED CODE ###

N,Q = [int(w) for w in input().split()]
i = 0
x = []
y = []
count = 0
while i < N:
    a,b = [int(w) for w in input().split()]
    x.append(a)
    y.append(b)
    i +=1
for i in range(N):
    m = (x[i]**2 + y[i]**2)**(1/2)
    if  m <= Q:
        count += 1
    else:
        count += 0
print(count)
N, M = map(int, input().split())
H = list(map(int, input().split()))
a = list(range(1,N+1))
for i in range(M):
  ai, bi = map(int, input().split())
  if H[ai-1] < H[bi-1] :
    a.remove(ai)
  else:
    a.remove(bi)
print(len(a))    
  

### FIXED CODE ###

N, M = map(int, input().split())
H = list(map(int, input().split()))
a = [True] * N
for i in range(M):
  ai, bi = map(int, input().split())
  if H[ai-1] <= H[bi-1] :
    a[ai-1] = False
  if H[ai-1] >= H[bi-1]:
    a[bi-1] = False
print(sum(a))
import math
A,B =  [int(x) for x in input().split(" ")]
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(A,B))

### FIXED CODE ###

def gcd(x,y):
    tmp = x
    x = x if x >= y else y
    if tmp != x:
        y = tmp
    if y == 0:
        return x
    return gcd(x%y, y)

A,B =  [int(x) for x in input().split(" ")]
def lcm(x, y):
    return (x * y) // gcd(x, y)
print(lcm(A,B))