Harryxun/stf_run huggingface dataset:
X,Y,Z,K = map(int,input().split())

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

A.sort(reverse=True)
A = A[0:K]
B.sort(reverse=True)
B = B[0:K]
AB = [a+b for a in A for b in B]

AB.sort(reverse=True)

AB = AB[0:K]

C.sort(reverse=True)
C=C[0:K]
ABC = [ab+c for ab in AB for c in C]

ABC.sort(reverse=True)

for i in range(K):
    print(ABC[i])


### FIXED CODE ###

import math

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

move= [A,B,C,D,E]
min_move =min(move) 
min_move_idx = move.index(min_move)
time = 4


time += math.ceil(N/min_move )

print(time)
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(1, n):
  b[a[i]] += 1

for e in b:
  print(e)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n-1):
  b[a[i]-1] += 1
  
for e in b:
  print(e)
n, k = map(int, input().split())
P = list(map(lambda x: int(x)-1, input().split()))
C = list(map(int, input().split()))


def dfs(i):
    if 0 <= visited[i]:
        return
    visited[i] = idx
    cycle.append(i)
    global csum
    csum += C[i]
    dfs(P[i])


visited = [-1]*n
idx = 0
cycles = []
for i in range(n):
    if 0 <= visited[i]:
        continue
    cycle = []
    csum = 0
    dfs(i)
    cycles.append((cycle, csum))
    idx += 1


INF = 10**18
ans = -INF
for i in range(n):
    cycle, csum = cycles[visited[i]]
    cmem = len(cycle)

    if 0 < csum:
        a, b = divmod(k, cmem)
        scoreA = csum*a
        score = 0
        INF = 10**18
        scoreB = -INF
        for _ in range(b):
            i = P[i]
            score += C[i]
            if scoreB < score:
                scoreB = score
        X = scoreA+scoreB
    else:
        b = min(k, cmem)
        score = 0
        INF = 10**18
        X = -INF
        for _ in range(b):
            i = P[i]
            score += C[i]
            if X < score:
                X = score

    if ans < X:
        ans = X
print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n, k = map(int, input().split())
P = list(map(lambda x: int(x)-1, input().split()))
C = list(map(int, input().split()))


def dfs(i):
    if 0 <= visited[i]:
        return
    visited[i] = idx
    cycle.append(i)
    global csum
    csum += C[i]
    dfs(P[i])


visited = [-1]*n
idx = 0
cycles = []
for i in range(n):
    if 0 <= visited[i]:
        continue
    cycle = []
    csum = 0
    dfs(i)
    cycles.append((cycle, csum))
    idx += 1


INF = 10**18
ans = -INF
for i in range(n):
    cycle, csum = cycles[visited[i]]
    cmem = len(cycle)

    if 0 < csum:
        a, b = divmod(k, cmem)
        scoreA = csum*(a-1)
        b += cmem
        score = 0
        scoreB = 0
        for _ in range(b):
            i = P[i]
            score += C[i]
            if scoreB < score:
                scoreB = score
        X = scoreA+scoreB
    else:
        b = min(k, cmem)
        score = 0
        INF = 10**18
        X = -INF
        for _ in range(b):
            i = P[i]
            score += C[i]
            if X < score:
                X = score

    if ans < X:
        ans = X
print(ans)
import math

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

def f(X, C, D):
    return int(X // C) + int(X // D) - int(X // ((C * D ) / math.gcd(C, D)))

ans = int((B - A + 1) - f(B, C, D) + f(A, C, D))

print("{}".format(ans, int))

### FIXED CODE ###

from math import gcd, ceil
a, b, c, d = map(int, input().split())

def f(s, x, y):
    lcm = x * y // gcd(x, y)
    ret = s // x + s // y - s // lcm
    return ret

print(b-a+1-f(b, c, d)+f(a-1, c, d))
n = int(input())
#x = []
#y = []
#h = []
l = []
for i in range(n):
    ex,ey,eh = map(int,input().split())
    #x.append(ex)
    #y.append(ey)
    #h.append(eh)
    if eh != 0:
        l.append([ex,ey,eh])

def func(cx,cy,l1,l2):
    ans1 = -abs(l1[0]-cx)+abs(l2[0]-cx)-abs(l1[1]-cy)+abs(l2[1]-cy)
    ans2 = l1[2]-l2[2]
    if ans1 == ans2:
        return True
    else:
        return False

def func2(cx,cy,l):
    ans = l[2] + abs(l[0]-cx) +  abs(l[1]-cy)
    return ans

cx = -1
cy = -1
flag = False
for i in range(101):
    for j in range(101):
        for k in range(n-1):
            if func(i,j,l[k],l[k+1]):
                if k == n-2:
                    cx = i
                    cy = j
                    flag = True
                    break
            else:
                break
        if flag:
            break
    if flag:
        break
h = func2(cx,cy,l[0])

print(cx, cy, h)

### FIXED CODE ###

n = int(input())
l = []
for i in range(n):
    ex,ey,eh = map(int,input().split())
    if eh != 0:
        l.append([ex,ey,eh])

def func2(cx,cy,l):
    ans = l[2] + abs(l[0]-cx) +  abs(l[1]-cy)
    return ans

if len(l) == 1:
    print(l[0][0], l[0][1], l[0][2])
    exit()

for i in range(101):
    for j in range(101):
        for k in range(len(l)-1):
            if func2(i,j,l[k]) == func2(i,j,l[k+1]):
                if k == len(l)-2:
                    print(i, j, func2(i,j,l[k]))
                    exit()
            else:
                break
a = input()
b = a.split()

if(b[0] + b[1] == 15):
    print('+')
elif(b[0] * b[1] == 15):
    print('*')
else:
    print('x')

### FIXED CODE ###

a = input()
b = a.split()

if(int(b[0]) + int(b[1]) == 15):
    print('+')
elif(int(b[0]) * int(b[1]) == 15):
    print('*')
else:
    print('x')
# d
import numpy as np
n, m = [int(i) for i in input().split()]
a = np.array([0]*m)
b = np.array([0]*m)
ans = np.array([0]*(n))
count =  np.array([0]*n)
roop = 0
Checks =  np.array([0]) # チェックする部屋の番号
Next =  np.array([]) # 次チェックする部屋番号をリストアップする
Li = np.array([1]*n)
for i in range(m):
    a[i], b[i] = [int(j)-1 for j in input().split()]

# 入力の受け取り完了
while np.sum(Li) != 0:
    roop += 1
    for check in Checks:
        if np.any(a == check):
            ind = np.where(a == check)
            nex = b[ind]
            ans[nex] = check+1
            Li[nex] = 0
#             print(nex)
        if np.any(b == check):
            ind = np.where(b == check)
            nex2 = a[ind]
            ans[nex2] = check+1
            Li[nex2] = 0
#             print(nex2)
    
    Next = np.append(Next, nex)
    Next = np.append(Next, nex2)
    Checks = []
    Checks = Next
#     print("roop = " + str(roop))
#     print(Next)
    # 初期化
    nex = []
    nex2 = []
    
    if roop == 1000:
        break
# print('ans')
print(ans[1:])

### FIXED CODE ###

from collections import deque
 
n,m = map(int,input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
path = [[] for _ in range(n+1)]
 
for a,b in ab:
    path[a].append(b)
    path[b].append(a)
 
q = deque([1])
ans = [0] * (n+1)
while q:
    v = q.popleft()
    for w in path[v]:
        if ans[w] == 0:
            ans[w] = v
            q.append(w)
 
print('Yes')
print(*ans[2:], sep="\n")
N, M = map(int, input().split())
if N = M:
	print("Yes")
    else:
    	print("No")


### FIXED CODE ###

n, m = map(int, input().split())
if n == m:
    print('Yes')
else:
    print('No')
print [S[:g]+S[g+1:]==(S[:g]+S[g+1:])[::-1] for g in range(len(S))].index(1)

### FIXED CODE ###

s = input()
count = 0
first_half, second_half = s[:len(s)//2], s[(len(s)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)
import sys
sys.setrecursionlimit(10**7)
n,q = map(int,input().split())
ki = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    ki[a-1].append(b-1)
    ki[b-1].append(a-1)
score = [0]*n

for i in range(q):
    p,x = map(int,input().split()) 
    score[p-1] += x
#print(ki,score)
ans = [0]*n

def dfs(v,p,value): #p:parent of v
    value +=score(v)
    #print(score[v],value)
    ans[v] = value
    for i in ki[v]:
        if i == p:
            continue
        dfs(i,v,value)
dfs(0,-1,0)

print(*ans)
        

### FIXED CODE ###

from collections import deque
n,q = map(int,input().split())
ki = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    ki[a-1].append(b-1)
    ki[b-1].append(a-1)
score = [0 for i in range(n)]

for i in range(q):
    p,x = map(int,input().split()) 
    score[p-1] += x

#print(ki,score)
ans = [0 for i in range(n)]

ans[0] = score[0]
visited = [False]*n
visited[0] = True
Q = deque([0])

while Q:
    d = Q.pop()
    #print(d)
    for to in ki[d]:
        if visited[to]:
            continue
        
        ans[to] = ans[d] + score[to]
        #print(ans[to],ans[d],score[to],d)
        visited[to] = True
        Q.append(to)
print(*ans)
import sys
import numpy as np

rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

h, w = rm()
li = np.array([np.array(rl()) for _ in range(h)])
li2 = np.array([])
li3 = np.array([])
for i in li:
  if '#' not in i:
    li2.append(i)
li2 = li2.T
for i in li2:
  if '#' not in i:
    li3.append(i)
for i in li3.T:
  print(''.join(i))

### FIXED CODE ###

import sys
import numpy as np

rm = lambda: map(int, sys.stdin.readline().split())
rr = lambda: sys.stdin.readline().rstrip()

h, w = rm()
li = np.array([np.array(list(rr())) for _ in range(h)])
li2 = []
li3 = []
for i in li:
  if '#' in i:
    li2.append(i)
li2 = np.array(li2).T
for i in li2:
  if '#' in i:
    li3.append(i)
li3 = np.array(li3).T
for i in li3:
  print(''.join(i))
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools


def main():
  r = (99, 2, 5, 5, 4, 5, 6, 3, 7, 6)
  n, _ = list(map(int, input().split()))
  ps = list(map(int, input().split()))

  cs = [(p, r[p]) for p in ps]
  cs.sort(key=lambda x: x[1])
  a = []
  s, b = cs[0]

  while n - b > 0:
    a.append(s)
    n -= b

  cs.sort(key=lambda x:-x[0])
  cs = [(p, c - b) for p, c in cs if c != b]
  ds = None

  for i in range(1, len(cs) + 1):
    for ps in itertools.product(range(len(cs)), repeat=i):
      if sum(cs[p][1] for p in ps) == n:
        ds = [cs[p][0] for p in ps]
        break

    if ds is not None:
      break

  uds = [d for d in ds if d >= s]
  lds = [d for d in ds if d < s][::-1]

  a = uds + a[len(uds):]
  a = a[-len(lds):] + lds

  print(''.join(str(v) for v in a), flush=True)


if __name__ == '__main__':
  main()



### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools

COSTS = (99, 2, 5, 5, 4, 5, 6, 3, 7, 6)


def gen(base_digit, base_cost, base_length, digits, remain):
  number = [base_digit] * base_length
  remain -= base_cost * base_length

  if remain == 0:
    print(''.join(str(d) for d in number), flush=True)
    return True

  digits = [(d, c - base_cost) for d, c in digits if d != base_digit and c - base_cost <= remain]

  if len(digits) == 0:
    return False

  max_repeat = min(remain // min(digits, key=lambda x: x[1])[1], len(number))
  numbers = []

  for repeat in range(1, max_repeat + 1):
    for idxs in itertools.product(range(len(digits)), repeat=repeat):
      if sum(digits[i][1] for i in idxs) != remain:
        continue

      replaces = [digits[i][0] for i in idxs]
      uppers = [d for d in replaces if d > base_digit]
      lowers = [d for d in replaces if d < base_digit]

      num = number[:]

      if len(uppers) > 0:
        num = uppers + num[len(uppers):]

      if len(lowers) > 0:
        num = num[:-len(lowers)] + lowers

      numbers.append(num)

  if len(numbers) == 0:
    return False

  number = max(numbers)

  print(''.join(str(d) for d in number), flush=True)

  return True


def main():
  remain, _ = list(map(int, input().split()))

  digits = {}

  for d in map(int, input().split()):
    if COSTS[d] not in digits or digits[COSTS[d]] < d:
      digits[COSTS[d]] = d

  digits = [(d, c) for c, d in digits.items()]
  base_digit, base_cost = min(digits, key=lambda x: x[1])

  for length in range(remain // base_cost, -1, -1):
    if gen(base_digit, base_cost, length, digits, remain):
      break


if __name__ == '__main__':
  main()
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

from collections import Counter
from math import factorial

c = Counter(s)
keys, values = zip(*c.most_common())
#print(keys)
#print(values)
ans = 0
n = 0
for i in range(len(values)):
    if values[i] != 1:
        n = values[i]
        ans += factorial(n) / factorial(2) / factorial(n - 2)
        
print(int(ans))

### FIXED CODE ###

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

from collections import Counter

c = Counter(s)
keys, values = zip(*c.most_common())
#print(keys)
#print(values)
ans = 0
n = 0
for i in range(len(values)):
    if values[i] > 1:
        n = values[i]
        ans += n*(n-1)//2
        
print(ans)
A, B = map(int, input().split())
print("{} {}".format((A - 1)(B - 1)))

### FIXED CODE ###

l = list(map(int, input().split()))
print((l[0] - 1 ) * (l[1] - 1))
#ABC050A
A, op, B = list(input().split())
if (op == '+'): print(A+B)
else: print(A-B)

### FIXED CODE ###

#ABC050A
A, op, B = list(input().split())
A = int(A)
B = int(B)

if (op == '+'): print(A+B)
else: print(A-B)
n, l = map(int, input().split)
if n = l:
  print("Yes")
 else:
  print("No")

### FIXED CODE ###

n, l = map(int, input().split())
if n == l:
  print("Yes")
else:
  print("No")
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys,collections

N = int(sys.stdin.readline())
a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param

from math import gcd
import math
pairwise = True
setwise = True
acc = a[0]
for i in range(N):
    acc = math.gcd(acc,a[i])
if acc != 1:
    print("not coprime")
    exit()

LIMIT=10**3
minPrime = [0]*(LIMIT+1)
minPrime[1] = 1
count = 0
for i in range(2,LIMIT):
    if minPrime[i] == 0:
        count += 1
        j = i
        while j <= LIMIT:
            if minPrime[j] == 0:
                minPrime[j] = i
            j += i

def factrial(N):
    ret = []
    while minPrime[N] != N:
        ret.append(N)
        N = N//minPrime[N]
    if N != 1:
        ret.append(N)
    return ret

# facts = [set(factrial(e)) for e in a]
s = set()
for e in a:
    f = set(factrial(e))
    if f & s:
        print("setwise coprime")
        exit()
    s = s | f
print("pairwise coprime")
# for i in range(N):
#     for j in range(i+1,N):
#         b = gcd(a[i],a[j])
#         if b != 1:
#             print("setwise coprime")
#             exit()
# if pairwise == True:
#     print("pairwise coprime")
# else:
#     print("not coprime")


### FIXED CODE ###

import math
from collections import defaultdict
pc = True
n = int(input())
a = list(map(int,input().split()))
g = math.gcd(a[0],a[1])
for i in range(2,n):
    g = math.gcd(g,a[i])
M = max(a)
class Sieve_of_Eratosthenes:
    def __init__(self, N):
        self.sieve = [-1] * (N+1)
 
        for i in range(2,N+1):
            if self.sieve[i] == -1:
                for j in range(1,1+N//i):
                    self.sieve[i*j] = i
 
    def isprime(self, num):
        if num <= 1:
            return False
        else:
            return self.sieve[num] == num
 
    def factorization(self, num):
        ret = set([])
        while num != 1:
            div = self.sieve[num]
            ret.add(div)
            num //= div
        return ret
 
sofe = Sieve_of_Eratosthenes(M)
ddic = defaultdict()
judge = set([])
 
for i in a:
    if not pc:
        break
    asf = sofe.factorization(i)
    
    if judge & asf != set():
        pc = False
    judge |= asf
if pc:
    print("pairwise coprime")
elif g == 1:
    print("setwise coprime")
else:
    print("not coprime")
n,k = map(int,input().split())
h = list(map(int, [input() for i in range(n)])).sort()
dif = []
for j in range(n-k+1):
  dif.appned(max(h[j:j+k-1])-min(h[j:j+k-1]))
print(min(dif))


### FIXED CODE ###

N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))
import math 
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
ans = ["pairwise coprime", "setwise coprime ", "not coprime"]

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
  
if gcd_list(A) != 1:
  print(ans[2])
  quit()
  
def seachPrimeNum(N):
    max = int(N ** (1 / 2))
    D = [0] * N
    D[0] = 1
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        nn = seachList[0]
        D[nn - 1] = nn
        primeNum.append(nn)
        tmp = nn
        for i in seachList:
          if i != nn:
            if i % tmp == 0:
              D[i - 1] = nn
        seachList = [i for i in seachList if i % tmp != 0]
    for i in seachList:
      D[i - 1] = i
    primeNum.extend(seachList)
    
    return primeNum, D  
  
primeNum, D = seachPrimeNum(1000000)
used = [0] * len(primeNum)

for i in range(N):
  now = A[i]
  q = []
  #print(now, D[now - 1])
  while now != D[now - 1]:
    now = int(now / D[now - 1])
    if now in primeNum:
      q.append(now)
  q.append(now)    
  for i in q:
    if used[primeNum.index(i)] == 0:
      used[primeNum.index(i)] = 1
    else:
      print(ans[1])
      quit()  

print(ans[0])


### FIXED CODE ###

from math import gcd
n = int(input())
a = [int(i) for i in input().split()]

g = a[0]
for i in range(n):
    g = gcd(g,a[i])
if g != 1:
    print("not coprime")
    exit()

m = max(a)
fac = [1]*(m+1)
for i in range(2,m+1):
    if fac[i] != 1:
      continue
    for j in range(i,m+1,i):
      fac[j] = i
      
s = set()
for i in range(n):
    x = fac[a[i]]
    if x == 1: 
      continue
    if x in s:
      print("setwise coprime")
      exit()
    s.add(x)
print("pairwise coprime")
def popcount(x):
    if x in memo:
        return memo[x]
    res=0
    while(x>0):
        if x&1:
            res+=1
        x//=2
    memo[x]=res
    return res
memo={}

N=int(input())
X=input()[::-1]
c=X.count('1')
count=[0]*(c+2)
for i in range(c+2):
    x=i
    cnt=0
    while(x>0):
        x=x%popcount(x)
        cnt+=1
    count[i]=cnt

if X[0]=='0':
    summ,sumn,sump=0,0,0
else:
    summ,sumn,sump=1,1,1
bitm,bitn,bitp=[0]*N,[0]*N,[0]*N
bitm[0],bitn[0],bitp[0]=1,1,1
for i in range(1,N):
    bitm[i]=bitm[i-1]*2%(c-1)
    bitn[i]=bitn[i-1]*2%c
    bitp[i]=bitp[i-1]*2%(c+1)
    if X[i]=='1':
        summ=(summ+bitm[i])%(c-1)
        sumn=(sumn+bitn[i])%c
        sump=(sump+bitp[i])%(c+1)
ans=[]
for i in range(N):
    if X[i]=='0':
        x=(sump+bitp[i])%(c+1)
        ans.append(count[x]+1)
    else:
        x=(summ-bitm[i]+c-1)%(c-1)
        ans.append(count[x]+1)
print(*ans[::-1],sep='\n')

### FIXED CODE ###

def popcount(x):
    if x in memo:
        return memo[x]
    res=0
    while(x>0):
        if x&1:
            res+=1
        x//=2
    memo[x]=res
    return res
memo={}

N=int(input())
X=input()[::-1]
c=X.count('1')
count=[0]*(c+2)
for i in range(c+2):
    x=i
    cnt=0
    while(x>0):
        x=x%popcount(x)
        cnt+=1
    count[i]=cnt

if X[0]=='0':
    summ,sumn,sump=0,0,0
else:
    summ,sumn,sump=1,1,1
bitm,bitn,bitp=[0]*N,[0]*N,[0]*N
bitm[0],bitn[0],bitp[0]=1,1,1
for i in range(1,N):
    if c>1:
        bitm[i]=bitm[i-1]*2%(c-1)
    bitn[i]=bitn[i-1]*2%c
    bitp[i]=bitp[i-1]*2%(c+1)
    if X[i]=='1':
        if c>1:
            summ=(summ+bitm[i])%(c-1)
        sumn=(sumn+bitn[i])%c
        sump=(sump+bitp[i])%(c+1)
ans=[]
for i in range(N):
    if X[i]=='0':
        x=(sump+bitp[i])%(c+1)
        ans.append(count[x]+1)
    else:
        if c==1:
            ans.append(0)
        else:
            x=(summ-bitm[i]+c-1)%(c-1)
            ans.append(count[x]+1)
print(*ans[::-1],sep='\n')
n, k, *hs = [int(x) for x in open(0).read().split()]
dp = [0] * n
for i in range(1, n):
    v = 10000
    for j in range(max(0, i - k), i):
        v = min(v, dp[j] + abs(hs[i] - hs[j]))
    dp[i] = v
print(dp[n-1])

### FIXED CODE ###

def delta(a, b):                                 
    return abs(a - b)                            
                                                 
n, *hs = [int(x) for x in open(0).read().split()]
l = len(hs)                                      
delta = lambda a, b: abs(hs[a] - hs[b])          
dp = [0, delta(1, 0)]                            
for i in range(2, l):                            
    dp.append(min(                               
        dp[i - 1] + delta(i, i - 1),             
        dp[i - 2] + delta(i, i - 2)))            
print(dp[-1])
n,k = map(int, input().split())
li = list(map(int, input().split()))
Li = list(n)
while set(Li)&set(li):
  n += 1
  Li = list(n)
else: print("".join(Li))

### FIXED CODE ###

n,k = map(str, input().split())
li = list(map(str, input().split()))
Li = list(n)
while len(set(Li)&set(li)):
  n = int(n)+1
  Li = list(str(n))
else: print("".join(Li))
N = int(input())
import itertools

l = []
for i in range(2,N+1):
    l.append(divisor_pl(i))
l = sum(l,[])
l.sort()

fac_dict = {}
fac_list = []
for key, value in itertools.groupby(l):
    fac_dict[str(key)] = len(list(value))
    fac_list.append(key)

count = 0
#(4,4,2)型のカウント
exp_list = []
for l in itertools.combinations(fac_list,3):
    a = []
    for i in range(3):
        a.append(fac_dict[str(l[i])])
    exp_list.append(a)

for l in exp_list:
    if all(i>=2 for i in l) and sum(i>=4 for i in l) >=2:
        count += 1

#(14,4)型のカウント
exp_list = []
for l in itertools.combinations(fac_list,2):
    a = []
    for i in range(2):
        a.append(fac_dict[str(l[i])])
    exp_list.append(a)

for l in exp_list:
    if all(i>=4 for i in l) and sum(i>=14 for i in l) >=1:
        count += 1

#(24,2)型のカウント
exp_list = []
for l in itertools.combinations(fac_list,2):
    a = []
    for i in range(2):
        a.append(fac_dict[str(l[i])])
    exp_list.append(a)

for l in exp_list:
    if all(i>=2 for i in l) and sum(i>=24 for i in l) >=1:
        count += 1

#(74)型のカウント
exp_list = []
for l in fac_list:
    exp_list.append(fac_dict[str(l)])

for l in exp_list:
    if l >= 74:
        count += 1
print(count)

### FIXED CODE ###

N = int(input())
import itertools

def divisor_pl(num):
    l = []
    i = 2
    while num > 1:
        if num%i == 0:
            l.append(i)
            num = int(num/i)
            i = 2
        else:
            i += 1
    if num != 1:
        l.append(num)
    return l

l = []
for i in range(2,N+1):
    l.append(divisor_pl(i))
l = sum(l,[])
l.sort()

fac_dict = {}
fac_list = []
for key, value in itertools.groupby(l):
    fac_dict[str(key)] = len(list(value))
    fac_list.append(key)

count = 0
#(4,4,2)型のカウント
for l in itertools.combinations(fac_list,3):
    for i in range(3):
        if fac_dict[str(l[i%3])] >= 4 and fac_dict[str(l[(i+1)%3])] >= 4 and fac_dict[str(l[(i+2)%3])] >= 2:
            count+=1

#(14,4)型のカウント
for l in itertools.combinations(fac_list,2):
    for i in range(2):
        if fac_dict[str(l[i%2])] >= 14 and fac_dict[str(l[(i+1)%2])] >= 4:
            count+=1

#(24,2)型のカウント
for l in itertools.combinations(fac_list,2):
    for i in range(2):
        if fac_dict[str(l[i%2])] >= 24 and fac_dict[str(l[(i+1)%2])] >= 2:
            count+=1

#(74)型のカウント
for l in fac_list:
    if fac_dict[str(l)] >= 74:
        count += 1

print(count)
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(a))

### FIXED CODE ###

import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
print(reduce(fractions.gcd,a))