Harryxun/stf_run huggingface dataset:
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        

money = min(listA[1]) + min(listA[2]) 

for k in range(listA[0][2]):
    wari = 1000
    a = listA[k+3][0]
    b = listA[k+3][1]
    if wari > listA[1][a-1] + listA[2][b-1] - listA[k+3][2]:
        wari = listA[1][a-1] + listA[2][b-1] - listA[k+3][2]

if money <= wari:
    print(money)
        
else:
    print(wari)


### FIXED CODE ###

listA=[]

while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        

money = min(listA[1]) + min(listA[2]) 
wari = 100000000

for k in range(listA[0][2]):
    a = listA[k+3][0]
    b = listA[k+3][1]
    if wari > listA[1][a-1] + listA[2][b-1] - listA[k+3][2]:
        wari = listA[1][a-1] + listA[2][b-1] - listA[k+3][2]

if money <= wari:
    print(money)
        
else:
    print(wari)
from collections import deque
s = deque(input())
cou = 0
while len(s)!=1:
  a = s[0]
  b = s[-1]
  if a=='x' and b!='x':
    cou += 1
    s.popleft()
  elif a!="x" and b=='x':
    cou += 1
    s.pop()
  elif a=="x" and b=='x':
    s.popleft()
    s.pop()
  elif a==b:
    s.popleft()
    s.pop()
  else:
    print(-1)
    exit()
print(cou)

### FIXED CODE ###

from collections import deque
s = deque(input())
cou = 0
while len(s)!=0:
  a = s[0]
  b = s[-1]
  if a=='x' and b!='x':
    cou += 1
    s.popleft()
  elif a!="x" and b=='x':
    cou += 1
    s.pop()
  elif a=="x" and b=='x':
    if len(s)==1:
      s.popleft()
    else:   
      s.popleft()
      s.pop()
  elif a==b:
    if len(s)==1:
      s.popleft()
    else:   
      s.popleft()
      s.pop()
  else:
    print(-1)
    exit()
print(cou)
a = int(input())
b = int(input())
if a >= 10 or b >= 10:
    print(-1)
else:
    print(a * b)


### FIXED CODE ###

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

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a * b)
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
n=[]
if n>m:
  print(0)
  exit()
for i in range(1,len(x)):  
  for j in range(i,len(x)):
    n.append(abs(x[0]-x[i-1])+abs(x[i]-x[j-1])+abs(x[j]-x[-1]))
print(min(n))


### FIXED CODE ###

n,m=map(int,input().split())
x=list(map(int,input().split()))
l=[]
ans=0
if n<m:
  x.sort()
  for i in range(m-1):
    l.append(x[i+1]-x[i])
  l.sort()
  for j in range(m-n):
    ans+=l[j]
print(ans)
n = int(input())

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
    
m = max(A)
if len(A) == 1:
    print(A[0])
else:
    for i in range(n):
        for j in range(i+1, n):
            m = min(m, gcd(A[i], A[j]))
    print(m)


### FIXED CODE ###

n = int(input())

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

t = max(A)

from fractions import gcd

for i in A:
    t = gcd(t, i)
print(t)
import math
A, B = map(int, input().split())
l = []
keta = int(math.log2(B)) + 1
fmt = '0' + str(keta) + 'b'
for i in range(A, B+1):
    l.append(format(i, fmt))
bbin = ['0'] * keta
for j in range(keta):
    for i in range(A, B+1):
        if l[i-A][j] == '1':
            if bbin[j] == '0':
                bbin[j] = '1'
            else:
                bbin[j] = '0'
print(int("".join(bbin), 2))

### FIXED CODE ###

A, B = map(int, input().split())
def xorchk(n):
    if n%4 == 0:
        return n
    elif n%4 == 1:
        return 1
    elif n%4 == 2:
        return n+1
    else:
        return 0
print(xorchk(A-1)^xorchk(B))
while(True):
    m,n = map(int,input().split())
    if not m: break
    a = list(range(1,m+1))
    b = [input() for _ in range(n)]
    t = [str(i+1) for i in range(n)]
    t[2::3]   = ["Fizz"]*len(t[2::3])
    t[4::5]   = ["Buzz"]*len(t[4::5])
    t[14::15] = ["FizzBuzz"]*len(t[14::15])
    i=0
    for j in range(n):
        if len(a) <2: break
        if b[j] != t[j]: del a[i]; continue
        i += 1
        i = i%len(a)
    print(" ".join(str(e) for e in a))


### FIXED CODE ###

while(True):
    m,n = map(int,input().split())
    if not m: break
    a = list(range(1,m+1))
    b = [input() for _ in range(n)]
    t = [str(i+1) for i in range(n)]
    t[2::3]   = ["Fizz"]*len(t[2::3])
    t[4::5]   = ["Buzz"]*len(t[4::5])
    t[14::15] = ["FizzBuzz"]*len(t[14::15])
    i=0
    for j in range(n):
        if len(a) <2: break
        if b[j] != t[j]: del a[i]; i = 0 if i >= len(a) else i; continue
        i += 1
        i = i%len(a)
    print(" ".join(str(e) for e in a))
n = input()
s = set(input().split())
if len(s) == n:
  print(YES)
else:
  print(NO)


### FIXED CODE ###

n = input()
a = list(input().split())

b = set(a)

if len(a) == len(b):
  print("YES")
else:
  print("NO")
import sys
def main():
    ans = [0] * 2
    for line in sys.stdin:
        try:
            a,b,c = map(int, line.split())
            if a ** 2 + b ** 2 == c ** 2:
                ans[0] += 1
            else:
                ans[1] += 1

            for a in ans:
                print(a)

        except EOFError:
            for a in ans:
                print(a)


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
def main():
    r = 0
    d = 0
    for line in sys.stdin:
        A = list(map(int, line.split(",")))
        if A[0] == A[1]:
            d += 1
        else:
            if A[0] ** 2 + A[1] ** 2 == A[2] ** 2:
                r += 1

    print(r)
    print(d)



if __name__ == "__main__":
    main()
import numpy as np
import sys
input = sys.stdin.readline


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = np.zeros(N)
        for i, a in enumerate(A):
            bottom = int(i - a)
            top = int(i + a + 1)
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] += np.ones(top-bottom)
        A = B[:]

    ans = ' '.join(list(map(str, map(int, A))))
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

S = input()
print(S[:3])
N = int(input())
G0, G1, G2, G3 = 0, 0, 0, 0
for i in range(N):
    Si = input()
    if Si == 'AG':
        G0 += 1
 
    elif Si == 'WA':
        G1  += 1
 
    elif Si == 'TLE':
        G2 += 1
 
    else:
        G3 += 1
 
print('AG x ' + str(G0))
print('WA x ' + str(G1))
print('TLE x ' + str(G2))
print('RE x ' + str(G3))

### FIXED CODE ###

n = int(input())

if n % 1000 == 0:
  print(0)
else:
  print(1000-(n%1000))
K,X = map(int,input().split())
P = K*500
if (p>=X):
    print("Yes")
elif (p<=X):
    print("No")    

### FIXED CODE ###

K,X = map(int,input().split())
P = K*500
if (P>=X):
    print("Yes")
elif (P<=X):
    print("No")
from numba import njit
import numpy as np
import sys
read = sys.stdin.read
readline = sys.stdin.readline

N = int(input())
S = np.array(list(read().rstrip()), np.int8)

R = np.sum(S == ord('R'))
B = np.sum(S == ord('B'))
G = np.sum(S == ord('G'))


@njit
def f(S):
    N = len(S)
    ret = 0
    for i in range(N):
        for j in range(i + 1, N):
            k = j + j - i
            if k >= N:
                break
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                ret += 1
    return ret


answer = R * B * G - f(S)
print(answer)


### FIXED CODE ###

n = int(input())
s = input()

r = g = b = 0
for i in range(n):
    if s[i] == 'R':
        r += 1
    elif s[i] == 'G':
        g += 1
    else:
        b += 1

x = 0
for i in range(n):
    for j in range(i+1, n):
        k = j + j - i
        if k < n and s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            x += 1
print(r*g*b-x)
n = int(input())
h = list(map(int, input().split()))

m = 0
ans  = []
while m <= n - 2:
	c = 0
	for i in range(m, n-1):
		if h[i] >= h[i+1]:
			c += 1
		else:
			break
	m = i + 1
	ans.append(c)


print(max(ans))


### FIXED CODE ###

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

m = 0
ans  = [0]
while m <= n - 3:
	c = 0
	for i in range(m, n-1):
		if h[i] >= h[i+1]:
			c += 1
		else:
			break
	m = i + 1
	ans.append(c)


print(max(ans))
a, b = map(int, raw_input().split())
if a * b < 0:
    print 'Zero'
elif n + m < 0 and abs(a - b) & 1 == 0:
    print 'Negative'
else:
    print 'Positive'


### FIXED CODE ###

a, b = map(int, raw_input().split())
if a * b < 0:
    print 'Zero'
elif a + b < 0 and abs(a - b) & 1 == 0:
    print 'Negative'
else:
    print 'Positive'
import sys

PI = 3.1415926

r = int(sys.stdin.readline().strip())
area = r * r * PI
periphery = r * 2 * PI

print('%.6f %.6f' % (area, periphery))

### FIXED CODE ###

import sys

PI = 3.141592653589793

r = float(sys.stdin.readline().strip())
area = r * r * PI
periphery = r * 2 * PI

print('%.6f %.6f' % (area, periphery))
q = int(input())
l, r = [0] * q, [0] * q
for i in range(q):
    l[i], r[i] = map(int, input().split())

mini = min(min(l), min(r))
maxi = max(max(l), max(r))
ans = [0] * (maxi + 1)
prime = [0] * (maxi + 1)
def judge_prime(n):
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    
    return True if n != 1 else False

for i in range((mini + 1) // 2, maxi + 1):
    prime[i] = judge_prime(i)

for i in range(mini, maxi + 1, 2):
    ans[i] = ans[i - 2] + 1 if prime[i] and prime[(i + 1) // 2] else ans[i - 2
for i in range(q):
    print(ans[r[i]] - ans[max(0, l[i] - 2)])


### FIXED CODE ###

q = int(input())
l, r = [0] * q, [0] * q
for i in range(q):
    l[i], r[i] = map(int, input().split())

mini = min(min(l), min(r))
maxi = max(max(l), max(r))
ans = [0] * (maxi + 1)
prime = [0] * (maxi + 1)
def judge_prime(n):
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    
    return True if n != 1 else False

for i in range((mini + 1) // 2, maxi + 1):
    prime[i] = judge_prime(i)

for i in range(mini, maxi + 1, 2):
    ans[i] = ans[i - 2] + 1 if prime[i] and prime[(i + 1) // 2] else ans[i - 2]
for i in range(q):
    print(ans[r[i]] - ans[max(0, l[i] - 2)])
s = input()
t = input()
dp = [[0] * len(t) for _ in range(len(s))]
for i in range(len(s)):
  if s[i] == t[0]:
    for k in range(i, len(s)):
      dp[k][0] = 1
    break
for j in range(tl):
  if s[0] == t[j]:
    for k in range(j, len(t)):
      dp[0][k] = 1
    break
for i in range(1, len(s)):
  for j in range(1, len(t)):
    if s[i] == t[j]:
      dp[i][j] = dp[i - 1][j - 1] + 1
    else:
      dp[i][j] = dp[i - 1][j]
      if dp[i][j] < dp[i][j - 1]:
        dp[i][j] = dp[i][j - 1]
i, j = len(s) - 1, len(t) - 1
u = []
while i >= 0 and j >= 0:
  if s[i] == t[j]:
    u.append(s[i])
    i -= 1
    j -= 1
  elif dp[i][j] == 0:
    break
  elif dp[i - 1][j] == dp[i][j]:
    i -= 1
  else:
    j -= 1
print(''.join(u[::-1]))


### FIXED CODE ###

s = input()
t = input()
slen = len(s)
tlen = len(t)
dp = [[0 for j in range(tlen + 1)] for i in range(slen + 1)]
for i in range(slen):
  for j in range(tlen):
    if s[i] == t[j]:
      dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + 1)
    dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i + 1][j])
    dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j + 1])
result = ''
i = slen
j = tlen
while i > 0 and j > 0:
  if dp[i - 1][j] == dp[i][j]:
    i -= 1
  elif dp[i][j - 1] == dp[i][j]:
    j -= 1
  else:
    result = s[i - 1] + result
    i -= 1
    j -= 1
print(result)
N,A=map(int,raw_input().split())
x=[0]+map(int,raw_input().split())
#print x

max_n=max(x)

dp=[[[0]*(N*max_n+1) for k in range(N + 1)] for j in range(N+1)]
#print dp


for j in range(N+1):
	for k in range(N+1):
		for s in range(N*max_n+1):
			if j==k==s==0:
				dp[j][k][s]=1
			elif j>=1 and s<x[j]:
				dp[j][k][s]=dp[j-1][k][s]
			elif j>=1 and k>=1 and s>=x[j]:
				dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-x[j]]
			else:
				dp[j][k][s]=0
#print dp


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

print ans
	
			
		

### FIXED CODE ###

N,A=map(int,raw_input().split())
x=[0]+map(int,raw_input().split())
#print x
y=map(lambda i:i-A, x)
#print y

max_x=max(max(x),A)
#print max_x

dp=[[0]*(2*N*max_x+1) for i in range(N+1)]

for j in range(N+1):
	for t in range(2*N*max_x):
		if j==0 and t==N*max_x:
			dp[j][t]=1
		elif j>=1 and (t-y[j]<0 or t-y[j]>2*N*max_x):
			dp[j][t]=dp[j-1][t]
		elif j>=1 and t-y[j]>=0 and 2*N*max_x>=t-y[j]: 
			dp[j][t]=dp[j-1][t]+dp[j-1][t-y[j]]
		else:
			dp[j][t]=0

print dp[N][N*max_x]-1
from math import ceil
n= input()
print(ceil(n/2)/n)

### FIXED CODE ###

from math import ceil
n= int(input())
print(ceil(n/2)/n)
def main():
    n = input()
    print(n ** 3)
    pass

if __name__ == '__main__':
    main()

### FIXED CODE ###

n = int(input())
print(n ** 3)
n = int(input())
a = list(map(int, input().split()))
ma = -100000000
mi = 100000000
for i in range(n):
    if a[i] > ma:
        ma = a[i]
        ma_index = i
    if a[i] < mi:
        mi = a[i]
        mi_index = i
ans = []
if ma >= -mi:
    for i in range(n):
        ans.append((ma_index,i))
    for i in range(n-1):
        ans.append((i,i+1))
else:
    for i in range(n):
        ans.appen((mi_index,i))
    for i in range(n-1):
        ans.append((n-1-i,n-2-i))
print(len(ans))
for x in ans:
    print(x[0],x[1])

### FIXED CODE ###

# coding: utf-8
import sys


def solve(a, begin, end, queue, cnt):
    #print(begin, end)
    if begin >= end:
        return
    maxx = sorted(list(map(abs, a[begin:end + 1])), reverse=True)[0]
    # print(maxx)
    if maxx in a[begin:end + 1]:
        m = a[begin:end + 1].index(maxx) + begin
    else:
        m = a[begin:end + 1].index(-1 * maxx) + begin
        maxx = -1 * maxx
    #print(m, maxx)
    if maxx == 0:
        return []
    if maxx > 0:
        solve(a, begin, m - 1, queue, cnt + 1)
        for i in range(max(0, m - 1), end):
            if a[i + 1] >= a[i]:
                continue
            else:
                a[i + 1] += a[i]
                queue.append((i, i + 1))
                if a[i + 1] < a[i]:
                    a[i + 1] += a[i]
                    queue.append((i, i + 1))
        return queue
    if maxx < 0:
        solve(a, m + 1, end, queue, cnt + 1)
        for i in reversed(range(begin, min(len(a) - 1, m + 1))):
            if a[i] <= a[i + 1]:
                continue
            else:
                a[i] += a[i + 1]
                queue.append((i + 1, i))
                if a[i] > a[i + 1]:
                    a[i] += a[i + 1]
                    queue.append((i + 1, i))
        return queue


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    queue = solve(a, 0, len(a) - 1, [], 0)
    print(len(queue))
    for i in range(len(queue)):
        print(queue[i][0] + 1, queue[i][1] + 1)
from itertools import permutations
a=list(map(int, input().split())) 
b=list(map(int, input().split())) 
l=list(permutations(a)))
print(abs((l.find(a))-(l.find(b))))


### FIXED CODE ###

from itertools import permutations
n=int(input())
a=tuple(map(int, input().split())) 
b=tuple(map(int, input().split())) 
l=list(i for i in permutations(range(1,n+1)))
print(abs((l.index(a))-(l.index(b))))
A = [list(map(int, input().split())) for i in range(3)]

n = int(input())

for j in range(n):
    b = int(input())
    for j in range(3):
        if A[j][0] == b:
            A[j][0] = 0
        if A[j][1] == b:
            A[j][1] = 0
        if A[j][2] == b:
            A[j][2] = 0

for k in range(3):
    if A[k][0]==a[k][1]==a[k][2]=0:
        print("Yes")
    elif A[0][k]==A[1][k]==A[2][k]==0:
        print("Yes")
        exit
if A[0][0]==A[1][1]==A[2][2]==0:
    print("Yes")
elif A[0][2]==A[1][1]==A[2][0]==0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
n = int(input())

for i in range(n):
    b = int(input())
    for j in range(3):
        if A1[j] == b:
            A1[j] = 0
        if A2[j] == b:
            A2[j] = 0
        if A3[j] == b:
            A3[j] = 0

if A1[0]==A1[1]==A1[2]==0:
    print("Yes")
    exit
elif A2[0]==A2[1]==A2[2]==0:
    print("Yes")
    exit
elif A3[0]==A3[1]==A3[2]==0:
    print("Yes")
    exit

elif A1[0]==A2[0]==A3[0]==0:
    print("Yes")
    exit
elif A1[1]==A2[1]==A3[1]==0:
    print("Yes")
    exit
elif A1[2]==A2[2]==A3[2]==0:
    print("Yes")
    exit
    
elif A1[0]==A2[1]==A3[2]==0:
    print("Yes")
    exit
elif A1[2]==A2[1]==A3[0]==0:
    print("Yes")
    exit
else:
    print("No")
from numpy import *
M=998244353
N,S,*A=map(int,open(0).read().split())
a=0
f = np.zeros(S+1, np.int64)
for b in As:
  f[0]+=1
  f[b:] += f[:-b].copy()
  f%=M
  a+=f[S]
print(a%M)

### FIXED CODE ###

#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

MOD = 998244353

N, S, *As = map(int, read().split())

U = 3010
answer = 0
f = np.zeros(U, np.int64)
for A in As:
    f[0] += 1
    f[A:] += f[:-A].copy()
    f %= MOD
    answer += f[S]

answer %= MOD
print(answer)
import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
# f=[0for _ in range(k+1)]
# for i in range(k+1):
#     for j in range(n):
#         f[i]+=a[j]^i
# f.sort(key=lambda x:-x)
a.sort(key=lambda x:-x)
powSize=math.ceil(math.log(k)/math.log(2))+1
digitCnt=[0for _ in range(powSize)]
for i in range(n):
    for j in range(powSize):
        if (a[i]&(1<<j))>0:
            digitCnt[j]+=1
ansNum=[0]
for i in range(powSize-1,-1,-1):
    if 2*digitCnt[i]<n: # digitCnt[i]<n-digitCnt[i]
        for j in range(len(ansNum)):
            ansNum[j]+=(1<<i)
            if ansNum[j]>k:
                if (ansNum[j]&(1<<(i+1)))>0:
                    ansNum.append(ansNum[j]-(1<<(i+1)))
                ansNum[j]-=(1<<i)
    # print(i,ansNum)

ans=[0for _ in range(len(ansNum))]
for i in range(n):
    for j in range(len(ansNum)):
        ans[j]+=(a[i]^ansNum[j])
# print(a[0],powSize)
# print(digitCnt)
# print(ansNum,ans)
ans.sort(key=lambda x:-x)
print(ans[0])


### FIXED CODE ###

import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
# f=[0for _ in range(k+1)]
# for i in range(k+1):
#     for j in range(n):
#         f[i]+=a[j]^i
# f.sort(key=lambda x:-x)
a.sort(key=lambda x:-x)
powSize=math.ceil(math.log(k+1)/math.log(2))
digitCnt=[0for _ in range(powSize)]
for i in range(n):
    for j in range(powSize):
        if ( a[i]&(1<<j) )>0:
            digitCnt[j]+=1
ansNum=[0]
for i in range(powSize-1,-1,-1):
    if 2*digitCnt[i]<n: # digitCnt[i]<n-digitCnt[i]
        for j in range(len(ansNum)):
            ansNum[j]+=(1<<i)
            if ansNum[j]>k:
                if ( ansNum[j]&(1<<(i+1)) )>0:
                    ansNum.append(ansNum[j]-(1<<(i+1)))
                ansNum[j]-=(1<<i)
    # print(i,ansNum)

# ansNum=[0for _ in range(powSize)]
# for i in range(powSize):
#     ansNum[i]=( k&(((1<<powSize)-1)<<(i+1)) )
#     for j in range(i):
#         if 2*digitCnt[j]<n:
#             ansNum[i]+=(1<<j)

ans=[0for _ in range(len(ansNum))]
for i in range(n):
    for j in range(len(ansNum)):
        if ansNum[j]<=k:
            ans[j]+=(a[i]^ansNum[j])
# print(a[0],powSize)
# print(digitCnt)
# print(ansNum,ans)
ans.sort(key=lambda x:-x)
print(ans[0])
s,t = input()
print(s+t)

### FIXED CODE ###

s = input().split()
print(s[1]+s[0])
n = int(input())
a = list(map(int,input().split()))
print(' '.join(a[::-2]+a[n%2::2]))

### FIXED CODE ###

n = int(input())
a = input().split()
print(" ".join(a[::-2]+a[n%2::2]))
N,A,B=map(int,input().split())
a=A+B
x=N//a
y=N%a
if y<=A:
    print(x*A+y)
else:
    print(x*(A+1))


### FIXED CODE ###

S=input()
if S[0]==S[1]==S[2]:
    print("No")
else:
    print("Yes")
i, all, sum = 0, 0, 0
while True:
    try:
        price, n = map(int, raw_input().split(","))
        i += 1; all += n; sum += price
    except
        break
    
print sum
print int(round(float(all)/i))

### FIXED CODE ###

i, all, sum = 0, 0, 0
while True:
    try:
        price, n = map(int, raw_input().split(","))
        i += 1; all += n; sum += price*n
    except:
        break
    
print sum
print int(round(float(all)/i))
x, y = map(int,input().split())
z = z+y
print(z) if z < 25 else print(z-24)

### FIXED CODE ###

x, y = map(int,input().split())
z = x+y
print(z) if z < 24 else print(z-24)
from math import gcd
n=int(input())
a=list(map(int,input().split()))

if n==2:
    b=max(a)
else:
    s1=gcd(a[0],a[1])
    s2=gcd(a[0],a[2])
    s3=gcd(a[2],a[1])
    c=gcd(s1,s2)
    b=max(s1,s2,s3)
    if b==s1:
        t=a[2]
    elif b==s2:
        t=a[1]
    else:
        t=a[0]
    if len(a)>=4:
        for i in a[3:]:
            d=gcd(b,i)
            if d>c:
                b=d
                c=gcd(c,i)
            else:
                t=i
                b=c
                c=d
print(b)



### FIXED CODE ###

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

s1=a[0]
s2=a[-1]
su=[s1]
sd=[s2]
for i in range(1,n-1):
    s1=gcd(s1,a[i])
    s2=gcd(s2,a[(i+1)*(-1)])
    su+=[s1]
    sd+=[s2]
sd.reverse()

ans=[su[-1],sd[0]]
for i in range(n-2):
    ans+=[gcd(su[i],sd[i+1])]
print(max(ans))
import scipy as sp

n, k = list(map(int, input().split()))
dekai = 10**9+7

def mycomb(a, b) :
    return int(sp.special.comb(a, b))%dekai

def usless(tukau, i) :
    if tukau-i+1 < 0 :
        return 0
    else :
        return mycomb(k-1, i-1)*mycomb(tukau-1,i-2)

def sousa(i) :
    if i == 1 :
        return n-k+1
    else :
        wa = 0
        for utan in range(n-k+1) :
            for satan in range(n-k+1-utan) :
                tukau = n-k-utan-satan
                wa += usless(tukau, i)
        return wa%dekai

for ii in range(k) :
    print(sousa(ii+1))

### FIXED CODE ###

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


def comb(n, r):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


for i in range(k) :
    ans = comb(n-k+1, i+1)*comb(k-1, i)%mod
    print(ans)
n = int(input())
tt = []
for i in range(n):
    tt.append(int(input()))
    
ss = int(1)

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i / q[0])

print(int(ss))

### FIXED CODE ###

n = int(input())
tt = []
for i in range(n):
    tt.append(int(input()))
    
ss = 1

for i in tt:
    p = []
    p.append(int(ss))
    p.append(int(i))
    q = list(sorted(p))
    while q[1] % q[0] != 0:
        r = [q[1] % q[0] , q[0]]
        s = list(sorted(r))
        q[0] = int(s[0])
        q[1] = int(s[1])

        
    ss = int(ss * i) // q[0]

print(ss)