Harryxun/stf_run huggingface dataset:
from copy import copy
def gcd(a, b):
	if a%b == 0:
		return b
	else:
		return gcd(b, a%b)

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

if n==2:
	print(max(a))
	quit()

a = list(set(a))

gcds = []
for i in range(len(a)):
	temp = copy(a)
	temp.pop(i)

	num1 = temp[0]
	num2 = temp[1]
	result = gcd(num1, num2)
	for j in range(2, len(temp)):
		if result in gcds:
			break
		result = gcd(result, temp[j])
	
	if result not in gcds:
		gcds.append(result)

if len(gcds)==1:
	print(gcds[0])
else:
	gcds = sorted(gcds)
	print(gcds[1])

### FIXED CODE ###

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

def factor(n):
	factors = [1, n]
	i=2
	while i*i <= n:
		if n%i==0:
			factors.append(i)
			factors.append(n//i)
		i+=1

	return factors

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

if n==2:
	print(max(A))
	quit()

gcd1 = 0
fac1 = sorted(factor(A[0]),reverse=True)
for i in range(len(fac1)):
	count = 0
	for j in range(1, n):
		if A[j]%fac1[i]!=0:
			count += 1
			if count >= 2:
				break
	if count <= 1:
		gcd1 = fac1[i]
		break

fac2 = sorted(factor(A[1]),reverse=True)
gcd2 = 0
for i in range(len(fac2)):
	count = 0
	for j in range(2, n):
		if A[j]%fac2[i]!=0:
			count += 1
			break
	if count <= 0:
		gcd2 = fac2[i]
		break

print(max(gcd1, gcd2))
import numpy as np

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

S = np.zeros((M,N),dtype=np.int64)
for m in range(M):
    tokens = input().split()
    K = int(tokens[0])
    for k in range(K):
        s = int(tokens[1+k])
        S[m,s-1] = 1 # s is 1-origin

p = [int(tk) for tk in input().split()]

ans = 0
for bits in range(1<<N):
	x = np.array([(bits>>b)&1 for b in range(N)],dtype=np.int64)
	y = S@x
	#print(y)
	for m in range(M):
		if (y[m]&1) != p[m]:
			break  
	else:
		ans += 1

print(ans)


### FIXED CODE ###

N,M = map(int,input().split())
S = []
for m in range(M):
	nums = list(map(int,input().split()))
	S.append(nums[1:])
#print(S)
p = list(map(int,input().split()))
#print(p)

ans = 0
for bits in range(1<<N):
	for m in range(M):
		on = 0
		for s in S[m]:
			on += (bits>>(s-1))&1
		if (on&1) != p[m]:
			break  
	else:
		ans += 1

print(ans)
S = input()
if S[1] != S[2] and S[2] != S[3] and S[3] != S[1]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
if S[0] != S[1] and S[1] != S[2] and S[2] != S[0]:
      print("Yes")
else:
  print("No")
import sys
import itertools
# import numpy as np
import time
import math

sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

tile = [0 for i in range(H)]
cnt = [[0 for _ in range(W)] for _ in range(H)]

for i in range(H):
    tile[i] = readline().decode().strip()

for i in range(H):
    done = [False for _ in range(W)]
    for j in range(W):
        if tile[i][j] == '#':
            continue
        if done[j]:
            continue
        l = 0
        while (j + l < W):
            if tile[i][j + l] == '#':
                break
            l += 1
        for k in range(l):
            cnt[i][j + k] += l
            done[j + k] = True

for j in range(W):
    done = [False for _ in range(H)]
    for i in range(H):
        if tile[i][j] == '#':
            continue
        if done[i]:
            continue
        l = 0
        while (i + l < W):
            if tile[i + l][j] == '#':
                break
            l += 1
        for k in range(l):
            cnt[i + k][j] += l
            done[i + k] = True

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(cnt[i][j] - 1, ans)
print(ans)



### FIXED CODE ###

import sys
import itertools
# import numpy as np
import time
import math

sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

tile = [0 for i in range(H)]
cnt = [[0 for _ in range(W)] for _ in range(H)]

for i in range(H):
    tile[i] = readline().decode().strip()

for i in range(H):
    done = [False for _ in range(W)]
    for j in range(W):
        if tile[i][j] == '#':
            continue
        if done[j]:
            continue
        l = 0
        while (j + l < W):
            if tile[i][j + l] == '#':
                break
            l += 1
        for k in range(l):
            cnt[i][j + k] += l
            done[j + k] = True

for j in range(W):
    done = [False for _ in range(H)]
    for i in range(H):
        if tile[i][j] == '#':
            continue
        if done[i]:
            continue
        l = 0
        while (i + l < H):
            if tile[i + l][j] == '#':
                break
            l += 1
        for k in range(l):
            cnt[i + k][j] += l
            done[i + k] = True

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(cnt[i][j] - 1, ans)
print(ans)
n = int(input())
v = list(map(int, input().split()))
t = [0]
s = 2000000000
for i in range(0, n):
  t.append(t[i]+v[i])
for i in range(0, n-1):
  s = min(s, abs(s-t[i+1])
print(s)

### FIXED CODE ###

n = int(input())
v = list(map(int, input().split()))
t = [0]
s = 2000000000
for i in range(0, n):
  t.append(t[i]+v[i])
for i in range(0, n-1):
  s = min(s, abs(t[n]-2*t[i+1]))
print(s)
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    l, r, d = map(int, input().split())
    G[l - 1].append((r - 1, d))
    G[r - 1].append((l - 1, -d))
X = [None] * N


def dfs(u):
    for w, d in G[u]:
        if X[w] is None:
            X[w] = X[u] + d
            if not dfs(w):
                return False
        elif X[w] - X[u] != d:
            return False

    return True


for i, x in enumerate(X):
    if x is None:
        X[i] = 0
        if not dfs(i):
            print("No")
            exit(0)

print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(200002)
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    l, r, q = map(int, input().split())
    G[l - 1].append((r - 1, q))
    G[r - 1].append((l - 1, -q))
X = [None] * N


def dfs(u):
    global X, G
    for w, d in G[u]:
        if X[w] is None:
            X[w] = X[u] + d
            if not dfs(w):
                return False
        else:
            if X[w] != X[u] + d:
                return False

    return True


flag = True
for i in range(N):
    if X[i] is None:
        X[i] = 0
        flag &= dfs(i)

if flag:
    print("Yes")
else:
    print("No")
a,b,c = input().split()

a = int(a)
b = int(b)
c = int(c)

import math

if abs(math.sqrt(c) - math.sqrt(b) - math.sqrt(a)) > 1e-10:
    if math.sqrt(c) - math.sqrt(b) - math.sqrt(a) > 0:
        print('Yes')
    else:
        print('No')
else:
    d = math.sqrt(c) * 1e10
    e = math.sqrt(b) * 1e10
    f = math.sqrt(a) * 1e10
    if math.sqrt(c\d) - math.sqrt(e) - math.sqrt(f) > 0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

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

if 4 * a * b < (c - a- b)**2 and c - a- b > 0:
    print("Yes")
else:
    print("No")
n,a,b,c = (i for i in input().split())
tim = 0
for i in range(n):
    if a[i] == b[i] and b[i] != c[i]:
        tim+=1
    elif b[i] == c[i] and c[i] != a[i]:
        tim+=1
    elif c[i] == a[i] and a[i] != b[i]:
        tim+=1
    elif c[i] == a[i] and a[i] == b[i]:
        tim+=0
    else:
        tim+=2
print(tim)

### FIXED CODE ###

n,a,b = (int(i) for i in input().split())
x=min(a,b)
y=a+b-n
if y < 0:
    y=0
print(x,y)
n = int(input())
a1 = int(input())
a2 = int(input())
if a[0] >= a[1]:
    maxa1 = a1
    maxa2 = a2
    res = 0
else:
    maxa1 = a2
    maxa2 = a1
    res = 1

for i in range(2, n):
    a_ = int(input())
    if maxa1 <= a_:
        maxa2 = maxa1
        maxa1 = a_
        res = i
    elif maxa2 <= a_:
        maxa2 = a_

for i in range(n):
    if i == res:
        print(maxa2)
    else:
        print(maxa1)

### FIXED CODE ###

n = int(input())
a1 = int(input())
a2 = int(input())
if a1 >= a2:
    maxa1 = a1
    maxa2 = a2
    res = 0
else:
    maxa1 = a2
    maxa2 = a1
    res = 1

for i in range(2, n):
    a_ = int(input())
    if maxa1 <= a_:
        maxa2 = maxa1
        maxa1 = a_
        res = i
    elif maxa2 <= a_:
        maxa2 = a_

for i in range(n):
    if i == res:
        print(maxa2)
    else:
        print(maxa1)
a = input()
b = input()

if a == b:
    print("EQUAL")
if len(a) > len(b):
    print("GREATER")
elif len(a) < len(b):
    print("LESS")
else:
    for i in range(len(a)):
        if int(a[i]) > int(b[i]):
            print("GREATER")
            break
        elif int(a[i]) < int(b[i]):
            print("LESS")
            break


### FIXED CODE ###

lines = input().split()
print(lines[0][0].upper()+lines[1][0].upper()+lines[2][0].upper())
n = int(input())
ls = [int(x) for x in input().split()]
a = 0
for i in range(n):
    for j in range(i):
        if ls[i] =< ls[j]:
            continue    
        else:
            a += 1
            break
print(n - a)


### FIXED CODE ###

n = int(input())
ls = list(map(int,input().split()))
min = ls[0]
k = 1
for i in range(1,n):
    if ls[i] < min:
        min = ls[i]
        k += 1
print(k)
def fib(n):
    f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
    return int(f)

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

time_f=[]

for i,v in enumerate(a):
    if i == 0:
        # print (fib(a[i]))
        time_f = fib(a[i])
    else:
        # print((a[i]-a[i-1]-1))
        # print (fib(a[i]-a[i-1]-1))
        time_f *=fib(a[i]-a[i-1]-1)


print(time_f%1000000007)

### FIXED CODE ###

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

dp =[0]*(n+1)

for i in a:
    dp[i] = -1

for i in [0,1]:
    if dp[i] == -1:
        dp[i] =0
    else:
        dp[i] =1

for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = 0
    else:
        if dp[i-1]==dp[i-2]==0:break
        dp[i] = (dp[i-2]+dp[i-1])

print(dp[-1]%1000000007)
n=int(input())
s=list(map(input().split()))
li=[0]*n
ans=0
for i in range(0,n):
  li[i]=sorted(s[i])
for j in range(0,n):
  for k in range(j+1,n):
    if li[j]==li[k]:
      ans+=1
      
print(ans)      

### FIXED CODE ###

n=int(input())
dic={}
for _ in range(0,n):
  s="".join(sorted(input()))
  if s in dic:
    dic[s]+=1
  else:
    dic[s]=1
    
ans=0    
for a in dic.values():
  ans+=(a*(a-1))/2
  
print(int(ans))
n=input()
lst=input().split()
cnt = 0
for i in range(0, len(lst)):
    m = i
    for j in range(i, len(lst)):
        if lst[m] > lst[j]:
            m = j
    if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt+=1

print (" ".join(map(str,lst)))
print (cnt)

### FIXED CODE ###

raw_input()
lst=map(int, raw_input().split())

cnt = 0
for i in range(0, len(lst)):
    m = i
    for j in range(i, len(lst)):
        if lst[m] > lst[j]:
            m = j
    if m != i:
        lst[i], lst[m] = lst[m], lst[i]
        cnt+=1

print " ".join(map(str,lst))
print (cnt)
n, m = map(int, input().split())
adj = [[] for _ in range(m)]
for i in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    adj[a].append(b)
    adj[b].append(a)
# print(adj)
from collections import deque
q = deque()
dist = [-1]*n
ans = [0]*n
q.append(0)
while q:
    now = q.popleft()
    for to in adj[now]:
        if dist[to] != -1: continue
        ans[to] = now 
        dist[to] = dist[now] + 1
        q.append(to)
    # print(adj[now], dist, ans, q)
    
print("Yes")
for i in range(1,n):
    print(ans[i]+1)


### FIXED CODE ###

n, m = map(int ,input().split())
 
adj = [[] for _ in range(n)]
 
for i in range(m):
    a, b = map(int, input().split())
    a-=1
    b-=1
    adj[a].append(b)
    adj[b].append(a)
 
from collections import deque
q = deque()
 
dist = [-1] * n
ans = [0] * n
 
q.append(0)
while len(q) != 0:
    now = q.popleft()
    for to in adj[now]:
        if dist[to] != -1:continue
        dist[to] = dist[now] + 1
        q.append(to)
        ans[to] = now
 
print("Yes")
for i in range(1, n):
    print(ans[i] + 1)
n = int(input())
root = set(range(n))
binary_tree = []
out = [0 for i in range(n)]
for i in range(n):
    l = list(map(int, input().split()))
    binary_tree.append(l)
    s = set(l[1:3])
    root -= s

def binary(id, parent, depth, sibling, height):
    output = {}
    hline = []
    hline.append(height)
    output['node'] = id
    output['parent'] = parent
    output['sibling'] = sibling
    output['depth'] = depth
    left = binary_tree[id][1]
    right = binary_tree[id][2]
    degree = 0
    if(parent == -1):
        output['type'] = 'root'
    elif(left == -1 and right == -1):
        output['type'] = 'leaf'
    else:
        output['type'] = 'internal node'
    if(left != -1):
        degree += 1
        hline.append(binary(left, id, depth+1, right, height))
    if(right != -1):
        degree += 1
        hline.append(binary(right, id, depth+1, left, height))
    max_height = max(hline)
    output['degree'] = degree
    output['height'] = max_height
    out[output['node']] = output
    return max_height + 1

binary(list(root)[0], -1, 0, -1, 0)
for line in out:
    print('node {}: parent = {}, sibling = {}, degree = {}, depth = {}, height = {}, {}'.format(line['node'], line['parent'], line['sibling'], line['degree'], line['depth'], line['height'], line['type']))



### FIXED CODE ###

n = int(input())
root = set(range(n))
binary_tree = [0 for i in range(n)]
#out = [0 for i in range(n)]
for i in range(n):
    l = list(map(int, input().split()))
    binary_tree[l[0]] = l
    s = set(l[1:3])
    root -= s

def binary(id, parent, depth, sibling, height):
    output = {}
    hline = []
    hline.append(height)
    output['node'] = id
    output['parent'] = parent
    output['sibling'] = sibling
    output['depth'] = depth
    left = binary_tree[id][1]
    right = binary_tree[id][2]
    degree = 0
    if(parent == -1):
        output['type'] = 'root'
    elif(left == -1 and right == -1):
        output['type'] = 'leaf'
    else:
        output['type'] = 'internal node'
    if(left != -1):
        degree += 1
        hline.append(binary(left, id, depth+1, right, height))
    if(right != -1):
        degree += 1
        hline.append(binary(right, id, depth+1, left, height))
    max_height = max(hline)
    output['degree'] = degree
    output['height'] = max_height
    binary_tree[id] = output
    return max_height + 1

binary(list(root)[0], -1, 0, -1, 0)
for line in binary_tree:
    print('node {}: parent = {}, sibling = {}, degree = {}, depth = {}, height = {}, {}'.format(line['node'], line['parent'], line['sibling'], line['degree'], line['depth'], line['height'], line['type']))
import sys
X = int(input())
MAX = 10**9
M = [0]
i = 1
while i**5 < MAX:
  M.append(i**5)
  M.append(-i**5)
  i += 1
#print(M)
  
for i in M:
  for j in M:
    if (i%MAX - j%MAX)%MAX == X%MAX:
      if j < 0:
        print(int(i**(1/5)), -int((-j)**(1/5)))
      else:
        print(int(i**(1/5)), int(j**(1/5)))
      sys.exit(0)


### FIXED CODE ###

import sys
X = int(input())
MOD = 10**9+7
M = [i*m for i in range(0, 10**4) for m in [-1, 1]]
for i in range(0, 10**4):
  for j in M:
    if i == j:
      break
    if X%(i-j)==0:
      if i**5-j**5==X:
        print(i, j)
        sys.exit(0)
def resolve():
    import statistics
    n = input()
    x = list(map(int, input().split()))
    m = round(statistics.mean(x))
    sum_val = 0
    for val in x:
        sum_val += (val - m) ** 2

    print(sum_val)

if __name__ == '__main__':
    resolve()

### FIXED CODE ###

def resolve():
    n, num = map(int, input().split())
    if n >= 10:
        print(num)
    else :
        print(num + 100*(10-n))

if __name__ == '__main__':
        resolve()
import math

x, y, X, Y = [int(i) for i in input().split()]

print (math.sqrt((x-X)**2+(y-Y)**2))

### FIXED CODE ###

import math

x, y, X, Y = [float(i) for i in input().split()]

print (math.sqrt((x-X)**2+(y-Y)**2))
s = input()
p = int(s)

x = 1

numbers = []

while (x <= p):
    x *= 2
    numbers.append(x)

y = numbers.pop()
answer = numbers.pop()

print(answer)




### FIXED CODE ###

s = input()
p = int(s)

x = 1

numbers = []

while (x <= p):
    x *= 2
    numbers.append(x)

if p == 1:
    answer = 1
else:
    y = numbers.pop()
    answer = numbers.pop()

print(answer)
n = int(input())
s = [input() for _ in range(n)]
t = s.sort()
x = 0
maxx = 0
for i in range(n-1):
    if s[i] == s[i+1]:
        x += 1
        if x == maxx:
            maxx = x
            t.append(s[i])
        elif x > maxx:
            maxx = x
            t = [s[i]]
    else:
        x = 0
for j in t:
    print(j)

### FIXED CODE ###

n = int(input())
s = [input() for _ in range(n)]
ss = sorted(s)
t = ss
x = 0
maxx = 0
for i in range(n-1):
    if ss[i] == ss[i+1]:
        x += 1
        if x == maxx:
            maxx = x
            t.append(ss[i])
        elif x > maxx:
            maxx = x
            t = [ss[i]]
    else:
        x = 0
for j in t:
    print(j)
N = int(input())
Alist = list(map(int, input().split()))
dp = [[0, 0] for i in range(N+1)]
dp[0][1] = -(3*10**9)
for i in range(1, N+1):
    dp[i][0] = max(dp[i-1][0]+Alist[i], dp[i-1][1]-Alist[i])
    dp[i][1] = max(dp[i-1][0]-Alist[i], dp[i-1][1]+Alist[i])
print(dp[N][0])


### FIXED CODE ###

N = int(input())
Alist = list(map(int, input().split()))
dp = [[0, 0] for i in range(N+1)]
dp[0][1] = -(3*10**9)
for i in range(1, N+1):
    Ai = Alist[i-1]
    dp[i][0] = max(dp[i-1][0]+Ai, dp[i-1][1]-Ai)
    dp[i][1] = max(dp[i-1][0]-Ai, dp[i-1][1]+Ai)
print(dp[N][0])
letters = [chr(i) for i in range(97,123)]
string  = input()
for j in range(len(string)) if string[j] in letters:
    letters.remove(string[j])
print(letters[0])

### FIXED CODE ###

letters = [chr(i) for i in range(97,123)]
string  = input()
for j in range(len(string)):
    if string[j] in letters:
        letters.remove(string[j])
    else:
        continue
if letters:
    print(letters[0])
else:
    print("None")
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))

expected_value = []
for i in range(len(p)):
    value = 0
    for j in range(1, p[i] + 1):
        value += j / p[i]
    expected_value.append(value)

### K個合算した数値の配列
cumsum = []
cumsum_temp = 0
for i in range(len(p) - K):
    if i == 0:
        cumsum_temp = sum(expected_value[:K])
    else:
        cumsum_temp = cumsum_temp - expected_value[i - 1] + expected_value[i + K]
    cumsum.append(cumsum_temp)

print(max(cumsum))



### FIXED CODE ###

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

expected_value = []
for i in range(len(p)):
    expected_value.append((p[i] + 1)/ 2)

### K個合算した数値の配列
cumsum = []
cumsum_temp = 0
for i in range(len(p) - K + 1):
    if i == 0:
        cumsum_temp = sum(expected_value[:K])
    else:
        cumsum_temp = cumsum_temp - expected_value[i - 1] + expected_value[i + K - 1]
    cumsum.append(cumsum_temp)
# print(f"N:{N} K:{K} expected_value:{expected_value} cumsum:{cumsum}")

print(max(cumsum))
A, B = map(int,input().split())
n=0
for i in range(A:B+1):
  s = str(i)
  if s[0]==s[4] and s[1]==s[3]:
    n+=1
print(n)

### FIXED CODE ###

A, B = map(int,input().split())
n=0
for i in range(A,B+1):
  s = str(i)
  if s[0]==s[4] and s[1]==s[3]:
    n+=1
print(n)
import math
import fraction
from functools import reduce


def lcm_base(x, y):
    return (x * y) // fraction.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


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

ans1 = 0

lcm = lcm_list(a)

for num in a:
    ans1 += (lcm - 1) % num

print(ans1)


### FIXED CODE ###

import fractions
from functools import reduce
 
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
 
 
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
 
n = int(input())
a = [int(i) for i in input().split()]
 
ans1 = 0
 
lcm = lcm_list(a)
 
for num in a:
    ans1 += (lcm - 1) % num
 
print(ans1)
n = int(input())
col = [0]*n
next = [[] for i in range(n)]
d = [float('INF')]*n
d[0]=0

def dfs(now):
    for next1,w1 in next[now]:
        if d[next1]>d[now]+w1:
            d[next1]=d[now]+w1
            dfs(next1)

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

dfs(0)

for i in range(n):
    if d[i]%2==0:
        print('0')
    else:
        print('1')


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)


n = int(input())
col = [0]*n
next = [[] for i in range(n)]
d = [float('INF')]*n
d[0]=0

def dfs(now,parent):
    for next1,w1 in next[now]:
        if next1 == parent:
            continue
        elif d[next1]==float('INF'):
            d[next1]=d[now]+w1
            dfs(next1,now)

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

dfs(0,-1)

for i in range(n):
    if d[i]%2==0:
        print('0')
    else:
        print('1')
N = list(map(int, input().split()))[-1]
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

first = [i+j for i in A for j in B]
first = sorted(first)[::-1]
second = [i+j for i in first for j in C if i >= first[N]]

print("\n".join([str(value) for value in sorted(second)[::-1][:N]]))

### FIXED CODE ###

N = list(map(int, input().split()))[-1]
A = sorted(list(map(int, input().split())), reverse=True)[:N]
B = sorted(list(map(int, input().split())), reverse=True)[:N]
C = sorted(list(map(int, input().split())), reverse=True)[:N]

first = [i+j for i in A for j in B]
first = sorted(first, reverse=True)[:N]
second = [i+j for i in first for j in C]
result = sorted(second, reverse=True)[:N]

[print(i) for i in result]
import math

n = int(input())
a = [0]*10001
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            ans = ((i + j) ** 2 + (j + k) ** 2 + (k + i) ** 2) //2
            a[ans] += 1

for i in range(1,n+1):
    print(a[i])

### FIXED CODE ###

import math

n = int(input())
a = [0]*100001
b = math.ceil(math.sqrt(n)) + 1
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            ans = ((i + j) ** 2 + (j + k) ** 2 + (k + i) ** 2) //2
            a[ans] += 1

for i in range(1,n+1):
    print(a[i])
h,w,m=map(int,input().split())
s=[0]*m
t=[0]*m
temp=[]*m
for i in range(m):
  sm,tm=map(int,input().split())
  s[i]=sm
  t[i]=tm
  temp[i]=[s[i],t[i]]
st=[0]*h
tt=[0]*w
for i in range(m):
  st[s[i]-1]=st[s[i]-1]+1
  tt[t[i]-1]=tt[t[i]-1]+1
smax=max(st)
tmax=max(tt)
ans=smax+tmax
maxs=[]
maxt=[]
for i in range(h):
  if st[i]==smax:
    maxs.append(i)
for i in range(w):
  if tt[i]==tmax:
    maxt.append(i)

if len(maxs)*len(maxt)>m:
  print(ans)
else:
  for i in range(len(maxs)):
    for j in range(len(maxt)):
      if (maxs[i]+1,maxt[j]+1) not in temp:
        print(ans)
        exit()
  else:
    print(ans-1)

### FIXED CODE ###

h,w,m=map(int,input().split())
s=[0]*m
t=[0]*m
temp=set()
for i in range(m):
  sm,tm=map(int,input().split())
  s[i]=sm
  t[i]=tm
  temp.add((s[i],t[i]))
st=[0]*h
tt=[0]*w
for i in range(m):
  st[s[i]-1]=st[s[i]-1]+1
  tt[t[i]-1]=tt[t[i]-1]+1
smax=max(st)
tmax=max(tt)
ans=smax+tmax
maxs=[]
maxt=[]
for i in range(h):
  if st[i]==smax:
    maxs.append(i)
for i in range(w):
  if tt[i]==tmax:
    maxt.append(i)

if len(maxs)*len(maxt)>m:
  print(ans)
else:
  for i in range(len(maxs)):
    for j in range(len(maxt)):
      if (maxs[i]+1,maxt[j]+1) not in temp:
        print(ans)
        exit()
  else:
    print(ans-1)