Harryxun/stf_run huggingface dataset:
import sys

INF = 10**9+7

stdin = sys.stdin
def na(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().strip()
def nsl(): return list(stdin.readline().strip())
def ni(): return int(stdin.readline())
def nil(): return list(map(int, stdin.readline().split()))

n = ni()

a = nil()

a.sort()

ans = 0

for i in range(n):
    ans += a[-2-i*n]
print(ans)

### FIXED CODE ###

import sys

INF = 10**9+7

stdin = sys.stdin
def na(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().strip()
def nsl(): return list(stdin.readline().strip())
def ni(): return int(stdin.readline())
def nil(): return list(map(int, stdin.readline().split()))

n = ni()

a = nil()
a.sort()
ans = 0

for i in range(n):
    ans += a[(-i*2) - 2]
print(ans)
a,b = int(input().split())

if a*b%2 == 0:
	print("No")
  
else:
	print("Yes")

### FIXED CODE ###

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

if a*b%2 == 0:
  print("No")

else:
  print("Yes")
N=int(input())
S=input()
if N%2==0:
    f,s=S[:int(N/2)], S[int(N/2):]
if f==s:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N=int(input())
S=input()
f='sf'
s='fs'
if N%2==0 and N!=0:
    f,s=S[:int(N/2)], S[int(N/2):]
if f==s:
    print('Yes')
else:
    print('No')
n = int(input())
x = 0
mn = 101
for i in range(n):
  s = int(input())
  x += s
  if x % 10 != 0
    if s < mn:
      mn = s
if x % 10 != 0:
  print(x)
else:
  x -= mn
  if x % 10 == 0:
    print(0)
  else:
    if x < 0:
      print(0)
      exit()
    print(x)
        

### FIXED CODE ###

n = int(input())
x = 0
mn = 100
for i in range(n):
  s = int(input())
  x += s
  if s % 10 != 0:
    if s <= mn:
      mn = s
if x % 10 != 0:
  print(x)
else:
  x -= mn
  if x % 10 == 0:
    print(0)
  else:
    if x < 0:
      print(0)
      exit()
    print(x)
import sys

readline = sys.stdin.readline

ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))

def solve():
  n, x, d = nm()
  ans = 0
  if d == 0:
    print(0 if x == 0 else n)
  if d < 0:
    d = -d
    x = -x
  g = dict()
  g[0] = [(0, 0)]
  for i in range(1, n+1):
    c, y = divmod(x * i, d)
    # print((c, y))
    f = (c + i*(i-1)//2, c + n*i - i*(i+1)//2)
    if y not in g:
      g[y] = list()
    g[y].append(f)
  for y in g:
    f = sorted(g[y])
    # print(f)
    cx, cy = f[0]
    for nx, ny in f:
      if nx <= cy:
        cx = min(nx, cx)
        cy = max(ny, cy)
      else:
        ans += cy - cx + 1
        cx, cy = nx, ny
    ans += cy - cx + 1
  print(ans)
  return

solve()

### FIXED CODE ###

import sys

readline = sys.stdin.readline

ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))

def solve():
  n, x, d = nm()
  ans = 0
  if d == 0:
    print(1 if x == 0 else n+1)
    return
  if d < 0:
    d = -d
    x = -x
  g = dict()
  g[0] = [(0, 0)]
  for i in range(1, n+1):
    c, y = divmod(x * i, d)
    # print((c, y))
    f = (c + i*(i-1)//2, c + n*i - i*(i+1)//2)
    if y not in g:
      g[y] = list()
    g[y].append(f)
  for y in g:
    f = sorted(g[y])
    # print(f)
    cx, cy = f[0]
    for nx, ny in f:
      if nx <= cy:
        cx = min(nx, cx)
        cy = max(ny, cy)
      else:
        ans += cy - cx + 1
        cx, cy = nx, ny
    ans += cy - cx + 1
  print(ans)
  return

solve()
from collections import defaultdict as dd
N = int(input())
edge = dd(lambda: dd(int))
for _ in range(N-1):
  a, b, w = map(int, input().split())
  edge[a-1][b-1] = w
  edge[b-1][a-1] = w

ans = [None] * N
def dfs(n, dist):
  ans[n] = dist % 2
  for t in edge[n]:
    if ans[t] is not None:
      continue
    dfs(t, dist + edge[n][t])
dfs(0, 0)
for a in ans:
  print(a)

### FIXED CODE ###

import sys
from collections import defaultdict as dd
sys.setrecursionlimit(100000)
N = int(input())
edge = dd(lambda: dd(int))
for _ in range(N-1):
  a, b, w = map(int, input().split())
  edge[a-1][b-1] = w
  edge[b-1][a-1] = w

ans = [None] * N
def dfs(n, dist):
  ans[n] = dist % 2
  for t in edge[n]:
    if ans[t] is not None:
      continue
    dfs(t, dist + edge[n][t])
dfs(0, 0)
for a in ans:
  print(a)
import numpy as np

ina = input()
N = int(ina)
x_list = []
y_list = []
dx_list = []
dy_list = []
for i in range(N):
  x,y,d = input().split()
  x_list.append(float(x))
  y_list.append(float(y))
  if d == 'L':
  	dx_list.append(-1)
  	dy_list.append(0)
  elif d == 'R':
  	dx_list.append(1)
  	dy_list.append(0)
  elif d == 'D':
  	dy_list.append(-1)
  	dx_list.append(0)
  elif d == 'U':
  	dy_list.append(1)
  	dx_list.append(0)


x = np.array(x_list)
y = np.array(y_list)
dx = np.array(dx_list)
dy = np.array(dy_list)

min_obj = (max(x)-min(x)) * (max(y)-min(y))

t = 0
t_min = 0
for t in range(1, 10000):
  x = x + dx*0.1
  y = y + dy*0.1
  obj = (max(x)-min(x)) * (max(y)-min(y))
  if obj < min_obj:
    min_obj = obj
    t_min = t
  if t_min + 500 < t:
    break
print(min_obj)

### FIXED CODE ###

ina = input()
ina = ina.split()
X = ina[0]
A = ina[1]
if X<A:
  print("0")
else:
  print("10")
#b
n=int(input())
xl=[]
for i in range(n):
    xl.append( list( map(int,input().split()) ) )

xl.sort(key=lambda x:x[0])


x = [xl[i][0] for i in range(n)]
l = [xl[i][1] for i in range(n)]
left = [x[i]-l[i] for i in range(n)]
right= [x[i]+l[i] for i in range(n)]

import bisect
rinsetu=[]
for i in range(n):
    migite   = bisect.bisect_left(left, right[i])
    hidarite = bisect.bisect_right(right, left[i]) 
#    print(migite,hidarite)
    migite_catch   = list(range(i+1,migite) )
    hidarite_catch = list(range(hidarite,i) )
    rinsetu.append( hidarite_catch + migite_catch )
#    rinsetu.append( migite_catch )

# n=6
# rinsetu=[[1,2],[0,2,3],[0,1,3,4],[1,2],[2,5],[4]]


ans = 0
if sum(len(r) for r in rinsetu)==0:
    print(n)
else:
    rinsetu,ans = remove_oya1(rinsetu,ans)
while True:
    if sum(len(r) for r in rinsetu) > 0:
        rinsetu,ans = remove_biggest(rinsetu,ans)
    else:
        print(n-ans)
        break
    
    if sum(len(r) for r in rinsetu) > 0:
        rinsetu,ans = remove_oya1(rinsetu,ans)
    else:
        print(n-ans)
        break

def remove_oya1(lis,c):
    neighbor = lis[:]
    i0=c
    for i in range(n):
        if len(neighbor[i]) == 1:
            oya=neighbor[i][0]
            for r in neighbor[oya]:
                neighbor[r].remove(oya)
            neighbor[oya]=[]
            i0+=1
    return neighbor, i0

def remove_biggest(lis,c):
    neighbor = lis[:]
    i0=c
    to_delete=0
    max_len=0
    for i in range(n):
        if len(neighbor[i]) > max_len:
            max_len=len(neighbor[i]) 
            to_delete=i
    
    oya=neighbor[to_delete]
    for r in oya:
        neighbor[r].remove(to_delete)
    neighbor[to_delete]=[]
    i0+=1
    return neighbor,i0
    

### FIXED CODE ###

n=int(input())
xlr=[[] for _ in range(n)]

for i in range(n):
    xx,ll = map(int,input().split())
    xlr[i] = [xx,ll,xx-ll,xx+ll]
    
xlr.sort(key = lambda x:x[3])

ans=1
right=xlr[0][-1]
for i in range(1,n):
    if right <= xlr[i][2]:
        ans+=1
        right=xlr[i][-1]

print(ans)
import itertools
S = input()
N = len(S)
S = '0' + S
A = [[int(i), len(list(v))] for i, v in itertools.groupby(S)]
if A[0][0] == A[-1][0] == 0 and A[1][0] == A[-2][0] == A[0][1] == A[-1][1] == 1:
    if len(A) == 3:
        #一直線
        for i in range(1, N):
            print(i, i + 1)
        exit()
    elif len(A) == 5 and A[1][1] == A[-2][1]:
        #脚の長さの最大値がA[1][1]+1のstar graph
        M = A[1][1] + 1
        Q, R = N // M, N % M
        #Q本の長さMの脚、1本の長さRの脚
        a = [[N] for _ in range(Q + 1)]
        for i in range(1, N):
            a[i % (Q + 1)] += [i]
        for b in a:
            for c, d in zip(b, b[1:]):
                print(c, d)
        exit()
print(-1)


### FIXED CODE ###

S = input()
N = len(S)
S = '0' + S
if S[:2] == '01' and S == S[::-1]:
    before = 1
    for i in range(2, N + 1):
        print(before, i)
        if S[i - 1] == '1' and i < (N + 1) // 2 + 2:
            before = i
else:
    print(-1)
n=int(input())
ashiba=list(map(int,input()))

cost=[0]*n

for item in range(1:n):
  print(item)

### FIXED CODE ###

n=int(input())
cost=list(map(int,input().split()))
 
ashiba=[0]*n
ashiba[1]=abs(cost[1]-cost[0])
#print(ashiba)
i=2
result=0
while i<n:
  ashiba[i]=min(abs(cost[i]-cost[i-1])+ashiba[i-1],abs(cost[i]-cost[i-2])+ashiba[i-2])
  #print(i,ashiba)
  i=i+1
  
print(ashiba[n-1])
n=int(input())

#データを並び替える
rowdata=[int(i) for i in input().split()]
rowdata.sort()

#nが偶数の時
if n%2==0:
    check=[]
    a=1
    for i in range(1,n,2):
        check.append(i)
        check.append(i)
    if check==rowdata:
        for i in range(int(n/2)):
            a*=2
            a=a%1000000007
            print(a)
    else:
        print(0)
        
#nが奇数の時
else:
    check=[]
    a=1
    if n==1:
        check=[0]
    else:
        for i in range(0,n,2):
            if i==0:
                check.append(i)
            else:
                check.append(i)
                check.append(i)
    if check==rowdata:
        print(int(2**((n-1)/2))%1000000007)
        for i in range(int((n-1)/2)):
            a*=2
            a=a%1000000007
            print(a)
    else:
        print(0)

        

### FIXED CODE ###

n=int(input())

#データを並び替える
rowdata=[int(i) for i in input().split()]
rowdata.sort()

#nが偶数の時
if n%2==0:
    check=[]
    a=1
    for i in range(1,n,2):
        check.append(i)
        check.append(i)
    if check==rowdata:
        for i in range(int(n/2)):
            a*=2
            a=a%1000000007
        print(a)
    else:
        print(0)
        
#nが奇数の時
else:
    check=[]
    a=1
    if n==1:
        check=[0]
    else:
        for i in range(0,n,2):
            if i==0:
                check.append(i)
            else:
                check.append(i)
                check.append(i)
    if check==rowdata:
        for i in range(int((n-1)/2)):
            a*=2
            a=a%1000000007
        print(a)
    else:
        print(0)
a, b = map(int,input().split())
if a*b%2 ==0:
	return("Even")
return("Odd")

### FIXED CODE ###

a, b = map(int,input().split())
if(a*b)%2==0:
	print("Even")
else:
	print("Odd")
n,m=map(int, input().split())
list1=[list(map(int,input().split())) for i in range(m)]

ans=['x']*n
non=0
for i in range(m):
    if ans[list1[i][0]-1]!='x':
        if int(ans[list1[i][0]-1])==list1[i][1]:
            continue
        else:
            non=-1
            break
    else:
        ans[list1[i][0]-1]=str(list1[i][1])

if non==-1:
    print(-1)
else:
    if ans[0]=='0':
        print(-1)
    else:
        if 'x' in ans:
            if ans[0]=='x':
                ans[0]='1'
            else:
                for i in range(n):
                    if ans[i]=='x':
                        ans[i]='0'
        K=''
        for i in range(n):
            K+=ans[i]
        print(int(K))

### FIXED CODE ###

n,m=map(int, input().split())
list1=[list(map(int,input().split())) for i in range(m)]

ans=['x']*n
non=0
for i in range(m):
    if ans[list1[i][0]-1]!='x':
        if int(ans[list1[i][0]-1])==list1[i][1]:
            continue
        else:
            non=-1
            break
    else:
        ans[list1[i][0]-1]=str(list1[i][1])

if non==-1:
    print(-1)
else:
    if ans[0]=='0' and n!=1:
        print(-1)
    else:
        if 'x' in ans:
            if ans[0]=='x' and n!=1:
                ans[0]='1'
            for i in range(n):
                if ans[i]=='x':
                    ans[i]='0'
        K=''
        for i in range(n):
            K+=ans[i]
        print(int(K))
A = input()
B = input()
A=int(A)
B=int(B)

if 0 <=A<=100 and 2<=B<=1000:
    if B%2 == 1:
        print("ERROR")
        exit()
    else :
        if A <=5 :
            fare=0
        elif 6<=A<=12 :
            fare=B//2
        else:
            fare=B
else:
    print("ERROR")
    exit()

print(fare)

### FIXED CODE ###

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

if 0 <=A<=100 and 2<=B<=1000:
    if B%2 == 1:
        print("ERROR")
        exit()
    else :
        if A <=5 :
            fare=0
        elif 6<=A<=12 :
            fare=B//2
        else:
            fare=B
else:
    print("ERROR")
    exit()

print(fare)
#001
vowel = "aeuio"
x=str(raw_input())
if x in vowel:
    print("vowel")
else:
    print("consonant")

### FIXED CODE ###

vowel = 'aeuio'
x=raw_input()
if x in vowel:
    print("vowel")
else:
    print("consonant")
N, K = map(int, input().split())
a_b = [list(map(input().split())) for i in range(N)]
a_b.sort()
index = 0

for i in range(N):
    index += a_b[i][1]
    if index >= K:
        print(a_b[i][0])
        exit()

### FIXED CODE ###

N, K = map(int, input().split())
a_b = [list(map(int, input().split())) for i in range(N)]
a_b.sort()
index = 0

for i in range(N):
    index += a_b[i][1]
    if index >= K:
        print(a_b[i][0])
        exit()
import copy

def main():
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a%b)

    def lcm(a, b):
        return (a // gcd(a, b)) * b

    n, m = map(int, input().split())
    # これだと72がREになる
    A = set([int(x) for x in input().split()])
    # これだと74も78もREになる
    # A = [int(x) for x in input().split()]
    # A_ = copy.deepcopy(A)
    # a_lcm = A.pop()
    a_lcm = 1
    # Aの要素が複数ならlcmを計算する
    #if len(A) >= 1:
    for a in A:
        a_lcm = lcm(a_lcm, a)
    #else:
    #    a_lcm = a_lcm
    # 元のAの値とlcmの半分の値を割り切れるものがあったら0
    #for i in A_:
    for i in A:
        if (a_lcm / 2) % i == 0:
        # if (a_lcm / i) % 2 == 0: 
            print(0)
            exit()
        # else:
        #     continue
    # mがlcmの半分よりも小さかったら0
    # if (a_lcm / 2) > m:
    if a_lcm > m * 2:
        print(0)
    else:
        # # あとは定数倍の数調べて終わり
        # ans = int((m - (a_lcm / 2))) // a_lcm + 1
        # ans = int((m - (a_lcm / 2)) // a_lcm) + 1
        # print(ans)
    
        # a_lcm = a_lcm // 2
        # q = m // a_lcm
        # if q % 2 == 0:
        #     ans = q // 2
        # else:
        #     ans = q // 2 + 1
        # print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる
w, h, x, y = map(int, input().split())
ans1 = (w * h) / 2.0
ans2 = 1 if w // x == h // y == 2 else 0
print(ans1, ans2)


### FIXED CODE ###

# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる
w, h, x, y = map(int, input().split())
ans1 = (w * h) / 2.0
ans2 = 1 if w / 2 == x and h / 2 == y else 0
print(ans1, ans2)
def main():
    from collections import deque

    N, M = map(int, input().split())
    connected_rooms = [[] for i in range(N + 1)]
    
    for i in range(M):
        a, b = map(int, input().split())
        connected_rooms[a].append(b)
        connected_rooms[b].append(a)
    
    def Breadth_First_Search(root):
        queue = deque([root]) #calculate distance from the root
        distance = [None] * (N + 1) #initialize distance
        distance[root] = 0
        
        while (queue): #do BFS and calculate distance recursively
            ver = queue.popleft()
            
            for index in connected_rooms[ver]:
                if (distance[index] == None):
                    distance[index] = distance[ver] + 1
                    queue.append(index)
        
        return (distance)
    
    dist = [None] * (N + 1)
    dist[0] = True
    
    Q = deque([1])
    while (Q):
        index = Q.popleft()
        for j in connected_rooms[index]:
            if (dist[j] == None):
                
                # dist[j] = index
                dist[j] = dist[index] + 1
                
                Q.append(j)
    
    if (all(dist)):
        print('Yes')
        for i in dist[2:]:
            print(i)
    else:
        print('No')


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    from collections import deque

    N, M = map(int, input().split())
    connected_rooms = [[] for i in range(N + 1)]
    
    for i in range(M):
        a, b = map(int, input().split())
        connected_rooms[a].append(b)
        connected_rooms[b].append(a)
    
    def Breadth_First_Search(root):
        queue = deque([root]) #calculate distance from the root
        distance = [None] * (N + 1) #initialize distance
        distance[root] = 0
        
        while (queue): #do BFS and calculate distance recursively
            ver = queue.popleft()
            
            for index in connected_rooms[ver]:
                if (distance[index] == None):
                    distance[index] = distance[ver] + 1
                    queue.append(i)
        
        return (distance)
    
    dist = [None] * (N + 1)
    dist[0] = True
    
    Q = deque([1])
    while (Q):
        index = Q.popleft()
        for j in connected_rooms[index]:
            if (dist[j] == None):
                dist[j] = index
                Q.append(j)
    
    if (all(dist)):
        print('Yes')
        for i in dist[2:]:
            print(i)
    else:
        print('No')


if __name__ == '__main__':
    main()
a = str(input())
while True:
  h = int(len(a)/2)
  for i in range(h-1):
    if all(a[i]==a[i+h]):
      print(len(a))
      exit()
  a.pop(-1)

### FIXED CODE ###

n = input()
num = len(n)-2
for i in range(num,0,-2):
  f = int(i/2)
  if n[:f]==n[f:i]:
    print(i)
    break
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,m,q=LI()
  l=[False]*n
  ans=0

  ll=[]
  for _ in range(q):
    _l=LI()
    ll.append(_l)

  for i in range(1<<n):
    l=[False]*n
    _ans=0
    for j in range(n):
      if i&(1<<j):
        a,b,c,d=ll[j]
        a-=1
        b-=1
        if l[a] and l[b]:
          continue
        l[a]=True
        l[b]=True
        _ans+=d
    ans=max(ans,_ans)
  return ans

# main()
print(main())


### FIXED CODE ###

import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

n=0
m=0
ans=-inf
l=[]

def dfs(s):
  global n
  global m
  global ans
  global l

  if len(s)==n:
    _ans=0
    for a,b,c,d in l:
      a-=1
      b-=1
      if s[b]-s[a]==c:
        _ans+=d
    ans=max(ans,_ans)

  if len(s)!=n:
    x=s[-1]
    for i in range(x,m+1):
      dfs(s+[i])

def main():
  global n
  global m
  global ans
  global l

  n,m,q=LI()
  l=[LI() for _ in range(q)]

  for i in range(1,m+1):
    dfs([i])

  return ans

# main()
print(main())
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue,fractions
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))
def inpl_str(): return list(sys.stdin.readline().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

n = inp()
t = inpln(n)
tmp = t[0]
for i in range(n-1):
    tmp = lcm(tmp, t[i+1])
print(tmp)


### FIXED CODE ###

from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue,fractions
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))
def inpl_str(): return list(sys.stdin.readline().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

n = inp()
t = inpln(n)
tmp = t[0]
for i in range(n-1):
    tmp = lcm(tmp, t[i+1])
print(tmp)
import sys
from collections import Counter
input = lambda : sys.stdin.readline().rstrip()

h, w, m = map(int, input().split(" "))

xs = []
ys = []
for i in range(m):
    x, y = map(int, input().split(" "))
    xs.append(x)
    ys.append(y)

xcounter = Counter(xs)
ycounter = Counter(ys)

x_most, x_most_num = xcounter.most_common(1)[0]
y_most, y_most_num = ycounter.most_common(1)[0]

out = 0
if x_most_num < y_most_num:
    #swap
    x_most_num = y_most_num
    tmp = ys
    ys = xs
    xs = tmp


out = x_most_num

y2s = [] 
for i in range(m):
    if xs[i] == x_most:
        continue
    else:  
        y2s.append(ys[i])
    

y2counter = Counter(y2s)
y2_most, y2_most_num = y2counter.most_common(1)[0]
out += y2_most_num

print(out)

### FIXED CODE ###

import sys
from collections import Counter
input = lambda : sys.stdin.readline().rstrip()

h, w, m = map(int, input().split(" "))

xs = []
ys = []
for i in range(m):
    x, y = map(int, input().split(" "))
    xs.append(x)
    ys.append(y)

xcounter = Counter(xs)
ycounter = Counter(ys)

x_most, x_most_num = xcounter.most_common(1)[0]
#y_most, y_most_num = ycounter.most_common(1)[0]

#if x_most_num < y_most_num:
#    x_most_num = y_most_num
#    tmp = ys
#    ys = xs
#    xs = tmp
#
out1 = x_most_num

if x_most_num < m:
    y2s = [] 
    for i in range(m):
        if xs[i] == x_most:
            continue
        else:  
            y2s.append(ys[i])
        
    y2counter = Counter(y2s)
    y2_most, y2_most_num = y2counter.most_common(1)[0]
    out1 += y2_most_num


y_most, y_most_num = ycounter.most_common(1)[0]

out2 = y_most_num

if y_most_num < m:
    x2s = [] 
    for i in range(m):
        if ys[i] == y_most:
            continue
        else:  
            x2s.append(xs[i])
        
    x2counter = Counter(x2s)
    x2_most, x2_most_num = x2counter.most_common(1)[0]
    out2 += x2_most_num

out = max(out1, out2)

print(out)
a,b,c,k = map(int,input().split())

if a>k:
    ans = k
elif a+b>k:
    ans = a
else:
    ans = a-(k-a-b)

print(ans)

### FIXED CODE ###

s=[]
s=list(input())

if s[-1]=='3':
    print("bon")
elif s[-1]=='0' or s[-1]=='1' or s[-1] =='6' or s[-1]=='8':
    print("pon")
else:
    print("hon")
// code 
x=int(input())
y=int(input())
z=int(input())
left=x-y
print(left%z)


### FIXED CODE ###

X = int(input())
A = int(input())
B = int(input())

P = X-A
PT = P % B
print(PT)
import sys
x = sys.argv[0]
t = sys.argv[1]
print x - t


### FIXED CODE ###

l = raw_input().split()
x = l[0]
t = l[1]
if int(x) - int(t) > 0:
    print int(x) - int(t)
else:
    print 0