Harryxun/stf_run huggingface dataset:
N = int(input())
A = list(map(int, input().split()))


# number_to_prime[i]: i の最小の素因数, iが素数ならば0
number_to_prime = [0] * (10**6 + 1)

# preprocess
for i in range(2, 10**6+1):
    if not number_to_prime[i]:
        j = 2
        while j*i <= 10**6:
            number_to_prime[j*i] = i
            j += 1


def is_pairwise():
    used_primes = set()
    pairwise_flag = 1
    for a in A:
        if a == 1:
            continue
        curr_primes = set()
        while number_to_prime[a]:
            prime = number_to_prime[a]
            curr_primes.add(prime)
            a //= prime
        curr_primes.add([a])
        if used_primes & curr_primes:
            pairwise_flag = 0
            break
        else:
            used_primes = used_primes | curr_primes
    return pairwise_flag

def is_setwise(*A):
    import math
    from functools import reduce

    return reduce(math.gcd, A) == 1

if is_pairwise():
    print("pairwise coprime")
elif is_setwise(*A):
    print("setwise coprime")
else:
    print("not coprime")

### FIXED CODE ###

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


# number_to_prime[i]: i の最小の素因数, iが素数ならば0
number_to_prime = [0] * (10**6 + 1)

# preprocess
for i in range(2, 10**6+1):
    if not number_to_prime[i]:
        j = 1
        while j*i <= 10**6:
            number_to_prime[j*i] = i
            j += 1

def is_pair_copr(A):
    import numpy as np
    U = 1 << 20
    div_p = np.arange(U)
    for p in range(2, U):
        if div_p[p] != p:
            continue
        div_p[p::p] = p
    used = np.zeros(U, np.bool_)
 
    for x in A:
        while x > 1:
            p = div_p[x]
            while x % p == 0:
                x //= p
            if used[p]:
                return False
            used[p] = True
    return True

def is_pairwise():
    used_primes = set()
    pairwise_flag = 1
    for a in A:
        curr_primes = set()
        while a > 1:
            prime = number_to_prime[a]
            curr_primes.add(prime)
            a //= prime
        if used_primes & curr_primes:
            pairwise_flag = 0
            break
        else:
            used_primes = used_primes | curr_primes
    return pairwise_flag

def is_setwise(*A):
    import math
    from functools import reduce

    return reduce(math.gcd, A) == 1

if is_pair_copr(A):
    print("pairwise coprime")
elif is_setwise(*A):
    print("setwise coprime")
else:
    print("not coprime")
height = []
while 1:
    h = raw_input()
    if h == '': break
    h = int(h)
    height.append(h)
height.sort(reverse=True)
for i in range(3):
    print height[i]

### FIXED CODE ###

height = []
while 1:
    try:
        height.append(input())
    except EOFError:
        break
height.sort(reverse=True)
for i in range(3):
    print height[i]
h,w,n=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(n)]
xy.sort()
cnt=0
ans=h
for i in range(n):
  if x-1>=y+cnt:
    ans=x-1
    break
  elif x==y+cnt:
    cnt+=1
print(ans)


### FIXED CODE ###

h,w,n=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(n)]
xy.sort()
cnt=0
ans=h
for x,y in xy:
  if x-1>=y+cnt:
    ans=x-1
    break
  elif x==y+cnt:
    cnt+=1
print(ans)
from bisect import bisect_left

n = int(input())
l = sorted(list(map(int,input().split())))
ans = 0

for i in range(n):
    for j in range(i+1,n):
        ans += bisect_left(l.,l[i]+l[j])-(j+1)
print(ans)

### FIXED CODE ###

from bisect import bisect_left
n = int(input())
l = sorted(list(map(int,input().split())))

ans = 0
for i in range(n):
    for j in range(i+1,n):
        ans += bisect_left(l,l[i]+l[j])-(j+1)
print(ans)
def programming_education(N: int) -> str:
    if N == 1:
        return 'Hello World'

    A, B = map(int, input().split())
    return str(A + B)


if __name__ == "__main__":
    N = int(input())
    ans = programming_education(N)
    print(ans)


### FIXED CODE ###

def programming_education(N: int) -> str:
    if N == 1:
        return 'Hello World'

    A = int(input())
    B = int(input())
    return str(A + B)


if __name__ == "__main__":
    N = int(input())
    ans = programming_education(N)
    print(ans)
def solve():
    a, b= map(int, input().split())
    if a > 12:
        return b
    elif 6 <= a <= 12:
        return b // 2
    else
        return 0
        


if __name__ == "__main__":
    print(solve())


### FIXED CODE ###

def solve():
    a, b = map(int, input().split())
    if a > 12:
        return b
    elif 6 <= a <= 12:
        return b // 2
    else:
        return 0


if __name__ == "__main__":
    print(solve())
a, b = list(map(int, input().split()))
number = 1
while a =< b:
    a += a - 1
    number += 1
print(number)

### FIXED CODE ###

forecasts     = input()
real_weathers = input()

correct_number = 0
for date in range(len(forecasts)):
    if forecasts[date] == real_weathers[date]:
        correct_number += 1
print(correct_number)
x = input())
a = ilist(map(int, input().split())
print("%d %d %d"%(min(a), max(a), sum(a)))


### FIXED CODE ###

x = input()
a = list(map(int, input().split()))
print("%d %d %d"%(min(a), max(a), sum(a)))
S = input()
T = input()

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    else:
        S[:] = T[-1] + T[1:]
else:
    print('No')

### FIXED CODE ###

S = input()
T = input()

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    else:
        S = S[-1] + S[0:-1]
else:
    print('No')
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
s = c+d
ans_list = sorted(set(s))
for num in ans_list:
  print(num)

### FIXED CODE ###

a,b,k = map(int,input().split())
if b+2 <= a+2*k:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,a+k):
    print(i)
  for i in range(b+1-k,b+1):
    print(i)
X = int(input())

lim = int(X**(1/2))

listx =[]

for i in range(lim+1):
    if i == 0 or i ==1:
        continue
    a = i
    p = 0
    while a < X:
        a = i ** p
        p += 1
    listx.append(i**(p-2))

print(max(listx))
        

### FIXED CODE ###

import sys
X = int(input())

lim = int(X**(1/2))

listx =[]

if X == 1 or X == 2 or X ==3:
    print(1)
    sys.exit()

if X >= 4 and X <= 8:
    print(4)
    sys.exit()

for i in range(lim+1):
    if i == 0 or i ==1:
        continue
    a = i
    p = 0
    while a <= X:
        a = i ** p
        p += 1
    listx.append(i**(p-2))

print(max(listx))
N = int(input())

if N < 1000:
    print('ABC'+str(N)
else:
    print('ABD'+str(N-1000))

### FIXED CODE ###

N = int(input())
if N >= 1000:
    print('ABD')
else:
    print('ABC')
def ABC086(a,b):
  a=int(input())
  b=int(input())

  if (a+b)%2==0:
    print('Even')
  else:
    print('Odd')
ABC086(a,b)

### FIXED CODE ###

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

if (a*b)%2==0:
  print('Even')
else:
  print('Odd')
n,m,r = map(int,input().split())
R = tuple(map(int,input().split()))
ABC = [list(map(int,input().split())) for _ in range(m)]
inf = 1000000000

edge = [[inf]*(n+1) for _ in range(n+1)]

for a,b,c in ABC:
    edge[a][b] = c
    edge[b][a] = c
    
def dijkstra(start,e,N):
    for v in range(1,N+1):#中間
        for g in range(1,N+1):#ゴール
            e[start][g] = min(e[start][g],e[start][v] + e[v][g])
            e[g][start] = e[start][g]
    return e[start]

cost = 0
dic = {}
for r in R:
    dic[r] = dijkstra(r,edge,n)

from itertools import permutations as pm

temp = list(pm(R))

ans = 10000000000
for RR in temp:
    cost = 0
    for i in range(r-2):
        cost += dic[RR[i]][RR[i+1]]
    if cost < ans:
        ans = cost

print(ans)

### FIXED CODE ###

n,m,rrr = map(int,input().split())
R = tuple(map(int,input().split()))
ABC = [list(map(int,input().split())) for _ in range(m)]
inf = 1000000000

edge = [[inf]*(n+1) for _ in range(n+1)]

for a,b,c in ABC:
    edge[a][b] = c
    edge[b][a] = c
    
def dijkstra(start,e,N):
    for _ in range(3):
        for v in range(1,N+1):#中間
            for g in range(1,N+1):#ゴール
                e[start][g] = min(e[start][g],e[start][v] + e[v][g])
                e[g][start] = e[start][g]
    return e[start]

dic = {}
for rr in R:
    dic[rr] = dijkstra(rr,edge,n)

from itertools import permutations as pm

temp = list(pm(R))

ans = 10000000000
for RR in temp:
    cost = 0
    for i in range(rrr-1):
        cost += dic[RR[i]][RR[i+1]]
    if cost < ans:
        ans = cost
print(ans)
N=[int(x) for x in input().split()]
A=[int(x) for x in input().split()]
sum=0
for a in range(N[1]):
    sum=sum+A[a]
if sum>=0:
   print(N[0]-sum)
else:
   print(-1)


### FIXED CODE ###

import math
N=int(input())
PI=math.pi
print(2.0*PI*N)
from collections import Counter
n = int(input())
k = n//2
a = list(map(int, input().split()))
p = []
q = []
for i in range(k):
    p.append(a[2*i])
    q.append(a[2*i+1])
s = Counter(p).most_common()
t = Counter(q).most_common()
u, v = len(s), len(t)
ans = 0
if s[0][0] == t[0][0]:
    if u == 1 and v == 1:
        ans = k
    elif u == 1:
        ans = k - t[1][1]
    elif v == 1:
        ans = k - s[1][1]
    else:
        comp = max(s[1][1], t[1][1])
        ans = n - s[0][1] - comp
else:
    ans = n - s[0][1] - t[0][1]
print(ans)



### FIXED CODE ###

s = input()
s = s.replace("1","2")

s = s.replace("9","1")

s = s.replace("2","9")

print(s)
import fractions
A=int(input())
B=int(input())
x = A * B // gcd(A, B)
print(x)


### FIXED CODE ###

import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
# 連結成分 + 1
# UF tree

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

root = list(range(N+1))
depth = [0] * (N+1)

def find_root(x):
  y = root[x]
  if x == y:
    return x
  z = find_root[y]
  root[x] = z
  return z

def merge(x,y):
  global n_component
  xx = find_root(x)
  yy = find_root(y)
  if xx == yy:
    return
  n_component -= 1
  if depth[xx] >= depth[yy]:
    root[yy] = xx
    depth[xx] += 1
  else:
    root[xx] = yy
    depth[yy] += 1
  
for _ in range(M):
  x,y,z = [int(x) for x in input().split()]
  merge(x,y)


answer = n_component
print(answer)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
# 連結成分
# UF tree

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

root = list(range(N+1))
depth = [0] * (N+1)

def find_root(x):
  y = root[x]
  if x == y:
    return x
  z = find_root(y)
  root[x] = z
  return z

def merge(x,y):
  global n_component
  xx = find_root(x)
  yy = find_root(y)
  if xx == yy:
    return
  n_component -= 1
  if depth[xx] >= depth[yy]:
    root[yy] = xx
    depth[xx] += 1
  else:
    root[xx] = yy
    depth[yy] += 1
  
for _ in range(M):
  x,y,z = [int(x) for x in input().split()]
  merge(x,y)

answer = n_component
print(answer)
n = (a * b) % 2
if n == 0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

a, b = map(int, input().split())
n = (a * b) % 2
if n == 0:
    print("Even")
else:
    print("Odd")
import sys
input = sys.stdin.readline

K,S=map(int,input().split())

z = list(range(K+1))
ans = []

for i in z:
  s_z = S - i
  if s_z < 0:
    pass
  elif K < s_z:
    if (K + 1) > (s_z - K):
      ans[i] = K + 1 - (s_z - K)
  else:
    ans[i] = s_z + 1

print(sum(ans))

### FIXED CODE ###

K,S=map(int,input().split())

z = list(range(0,K+1))
answer = []

for i in z:
  s_z = S - i
  if s_z < 0:
    pass
  elif K < s_z:
    if (K + 1) > (s_z - K):
      answer.append(K + 1 - (s_z - K))
  else:
    answer.append(s_z + 1)

print(sum(answer))
a, s, = map(input())

if a >= '3200':
    print(s)
if a < '3200':
    print('red')

### FIXED CODE ###

a = input()
s = input()
if a >= '3200':
    print(s)
if a < '3200':
    print('red')
s,t = map(list, input().split())
k = []
for i in range(len(s)):
    k.append(s[i] == t[i])
print(len(s)-sum(k))

### FIXED CODE ###

s = list(input())
t = list(input())
k = []
for i in range(len(s)):
    k.append(s[i] == t[i])
print(len(s)-sum(k))
from scipy.special import comb

n, m= [int(i) for i in input().split(" ")]

c = []
i = 2
mt = m

while i * i <= mt:
    ci = 0
    while mt % i == 0:
        mt = mt // i
        ci += 1
    if ci > 0:
        c.append(ci)
    i += 1
if mt > 1:
    c.append(1)
    
p = 1
for j in range(0, len(c)):
    p *= comb(n - 1 + c[j], c[j], exact=True)

print(p % (10**9 + 7))

### FIXED CODE ###

from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n, m= [int(i) for i in input().split(" ")]

c = []
i = 2
mt = m

while i * i <= mt:
    ci = 0
    while mt % i == 0:
        mt = mt // i
        ci += 1
    if ci > 0:
        c.append(ci)
    i += 1
if mt > 1:
    c.append(1)
    
p = 1
for j in range(0, len(c)):
    p *= comb(n - 1 + c[j], c[j])

print(p % (10**9 + 7))
a,b,c = map(int,input().split())
if sqrt(a) + sqrt(b) < sqrt(c):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c = map(int,input().split())
if (c-b-a) > 0 and (c-b-a)**2 > 4*a*b:
    print("Yes")
else:
    print("No")
A=int(input())
B=int(input())
C=int(input())
K=int(input())
maxi=2*A-K+B
print(maxi)

### FIXED CODE ###

S=input()
T=input()
if 1<=len(S)<=10 and (S.islower() and S.islower()) and S==T[:-1]:
    print("Yes")
else:
    print("No")
import array
import itertools


def is_merged(n):
    end = n // 2 
    for dev in range(2, end + 1):
        if n % dev == 0:
            return True
    return False


def sieve_of_eratosthenes(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = array.array(typecode)
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes

primes = sieve_of_eratosthenes(55555)



def is_merged(n):
    count = 0
    half = n // 2
    while(primes[count] <  half):
        if n % primes[count] == 0:
            return True
        count += 1
    return False




n = int(input())
ret = []
count = 0
for n in range(n):
    while(True):
        if prime[count] % 2 ==0:
            ret.append(prime(count))
            break
        count += 1
print(" ".join(map(str, ret)))

    




### FIXED CODE ###

import array
import itertools


def sieve_of_eratosthenes(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = array.array(typecode)
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes

primes = sieve_of_eratosthenes(55555)


n = int(input())
ret = []
count = 0
for _ in range(n):
    while(True):
        if primes[count] % 5==1:
            ret.append(primes[count])
            count += 1
            break
        count += 1
print(" ".join(map(str, ret)))
def compare_cards(a, b):
    return a[1] < b[1]

def bubble(C):
    for i in range(len(C)):
        for j in range(len(C) - 1, i, -1):
            if compare_cards(C[j], C[j - 1]):
                C[j], C[j - 1] = C[j -1], C[j]

N = int(input())
C = input().split()

bubbleC = C.copy()

#bubble(bubbleC)
compare_cards(C[0],C[1])
print(*C)

### FIXED CODE ###

def compare_cards(a, b):
    return a[1] < b[1]

def bubble(C):
    for i in range(len(C)):
        for j in range(len(C) - 1, i, -1):
            if compare_cards(C[j], C[j - 1]):
                C[j], C[j - 1] = C[j -1], C[j]

def selection(C):
    for i in range(len(C)):
        mini = i
        for j in range(i, len(C)):
            if compare_cards(C[j], C[mini]):
                mini = j
        C[i], C[mini] = C[mini], C[i]

def check_stable(originC, sortedC):
    for i in range(len(originC) - 1):
        if not compare_cards(sortedC[i], sortedC[i + 1]):
            if originC.index(sortedC[i]) > originC.index(sortedC[i + 1]):
                return 'Not stable'
    return 'Stable'

        
N = int(input())
C = input().split()

bubbleC = list(C)
selectionC = list(C)

bubble(bubbleC)
selection(selectionC)

print(*bubbleC)
print(check_stable(C, bubbleC))
print(*selectionC)
print(check_stable(C, selectionC))
l, r, d = map(int, input().split(' '))
count = 0
for i range(l, r + 1):
  if i % d == 0:
    count += 1
print(count)

### FIXED CODE ###

def main():
    l, r, d = map(int, input().split(' '))
    count = 0
    for i in range(l, r + 1):
        if i % d == 0:
            count += 1
    print(count)

if __name__ == '__main__':
    main()
hoge = str(input())
a = int(hoge[:2])
b = int(hoge[2:4])

if 0 < a and a <= 12:
  result = "MMYY"
  if 0 < b and b <= 12:
    result = "AMBIGUOUS"
if 0 < b and b <= 12:
  result = "YYMM"
  if 0 < a and a <= 12:
    result = "AMBIGUOUS"
if result == None:
  result = "NA"

print(result)

### FIXED CODE ###

hoge = str(input())
a = int(hoge[:2])
b = int(hoge[2:4])
result = None

if 0 < a and a <= 12:
  result = "MMYY"
  if 0 < b and b <= 12:
    result = "AMBIGUOUS"
if 0 < b and b <= 12:
  result = "YYMM"
  if 0 < a and a <= 12:
    result = "AMBIGUOUS"
if result == None:
  result = "NA"

print(result)
# coding:utf-8

K, A, B = map(int, raw_input().split())
n=0

if A <= B:
    print '-1'
else:
    for i in range(K+1):
        if (A*(n+2)-B*(n+1))>K and (A*(n+1)-B*n)<K:
            print 2*n+3
        n+=1

### FIXED CODE ###

# coding:utf-8

K, A, B = map(int, raw_input().split())
if K <=A:
    print 1

elif A <= B:
    print -1
else:
    x = (K-B-1)/(A-B)+1
    print 2*x-1
import math
n=int(input())
number=list(map(int,input().split()))
SUM=[]
sum=0
for i in range(1,n+1):
  sum+= fraction(1,i)
  sum= sum%(10**9 +7)
  SUM.append(sum)
ans=0
x=math.factorial(n)%(10**9 +7)
for i in range(n):
  ans+= number[i]*(x*int(SUM[n-1-i]+SUM[i]-1))
  ans=ans%(10**9 +7)
print(ans)

### FIXED CODE ###

import math
n=int(input())
number=list(map(int,input().split()))
SUM=[]
sum=0
p=10**9 +7
x=math.factorial(n)%(10**9 +7)
for i in range(1,n+1):
  k=pow(i,p-2,p)
  sum+= (x*k)%p
  sum= sum%(p)
  SUM.append(sum)
ans=0
for i in range(n):
  ans+= number[i]*(SUM[n-1-i]+SUM[i]-x)
  ans=ans%(p)
print(ans)
N, M = map(int, input().split())
heights = list(map(int, input().split()))
 
good = [True] * N
for m in range(0, M):
  A, B = map(int, input().split())
  if heights[A] > heights[B]:
    good[B] = False
  elif heights[A] < heights[B]:
    good[A] = False
    
count = 0
for obs in good:
  if obs: count += 1
    
print(count)


### FIXED CODE ###

N, M = map(int, input().split())
heights = list(map(int, input().split()))
 
greatest = [0] * N
for m in range(0, M):
  A, B = [int(s)-1 for s in input().split()]
  greatest[A] = max(greatest[A], heights[B])
  greatest[B] = max(greatest[B], heights[A])
    
count = 0
for i in range(0, N):
    count += heights[i] > greatest[i]
    
print(count)
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())

    ans = [0] * (1000 + 1)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x * x + y * y + z * z + x * y + y * z + z * x >= 1001:
                    continue
                ans[x * x + y * y + z * z + x * y + y * z + z * x] += 1

    for i in range(1, N + 1):
        print(ans[i])


if __name__ == '__main__':
    main()



### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())

    ans = [0] * (10000 + 1)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x * x + y * y + z * z + x * y + y * z + z * x >= 10001:
                    continue
                ans[x * x + y * y + z * z + x * y + y * z + z * x] += 1

    for i in range(1, N + 1):
        print(ans[i])


if __name__ == '__main__':
    main()
n = int(input())

ans = 0
for i in range(1, n+1):
  num = i
  digits=0
  while num:
    digits += 1
    num//=10
  if digit%2==1:
    ans+=1
    
print(ans)

### FIXED CODE ###

n = int(input())

ans = 0
for i in range(1, n + 1):
    num = i
    digits = 0
    while num:
        digits += 1
        num //= 10
    if digits % 2 == 1:
        ans += 1

print(ans)
n,m = map(int,input().split())
a = [int(i) for i in input().split()]
s = sum(a)
if(n=>s):
  print(n-s)
else:
  print("-1")

### FIXED CODE ###

n,m = map(int,input().split())
a = [int(i) for i in input().split()]
s = sum(a)
if(n>=s):
  print(n-s)
else:
  print("-1")
def gcd(a, b):
    if a == b or b == 0:
        return a
    elif b == 0:
        return a
    elif a > b:
        return gcd(a - b, b)
    elif a < b:
        return gcd(a, b - a)

def gcd_arr(arr, N):
    if N == 2:
        return gcd(arr[0], arr[1])
    elif N == 1:
        return arr[0]
    else:
        mid = N // 2
        return gcd(gcd_arr(arr[:mid], mid), gcd_arr(arr[mid:], N-mid))

def gcd_arr_with_rm(arr, N, remove = 0):
    return gcd_arr(arr[0:remove] + arr[(remove+1):], N - 1)

def solve():
    N = int(raw_input())
    arr = [int(_) for _ in raw_input().split()]
    max_gcd = 1
    for j in range(N):
        tmp = gcd_arr_with_rm(arr, N, remove = j)
        if tmp > max_gcd:
            max_gcd = tmp
    print str(max_gcd)

if __name__ == '__main__':
    solve()


### FIXED CODE ###

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

def solve():
    N = int(raw_input())
    arr = [int(_) for _ in raw_input().split()]
    left = [0] * (N + 1)
    right = [0] * (N + 1)
    left[0] = 0
    right[N] = 0
    for i in range(1, N+1):
        left[i] = gcd(left[i - 1], arr[i - 1])
    for i in range(N - 1, 0, -1):
        right[i] = gcd(right[i + 1], arr[i])
    max_gcd = 0
    for i in range(N):
        max_gcd = max(max_gcd, gcd(left[i], right[i+1]))
    print str(max_gcd)

if __name__ == '__main__':
    solve()
while True:
x=input().split()
a=int(x[0])
op=x[1]
b=int(x[2])
if op=="+":
  print(a+b)
elif op=="-":
   print(a-b)
elif op=="*":
   print(a*b)
elif op=="/":
   print(a/b)
else:
    break


### FIXED CODE ###

while True:
    x=input().split(" ")
    a=int(x[0])
    op=x[1]
    b=int(x[2])
    if op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)
    elif op == "?":
        break
n = input()
print(input().count("ABC"))


### FIXED CODE ###

k, x = map(int, input().split())
if 500*k >= x:
  print("Yes")
else:
  print("No")
s=input()
n=n.replace("1","X")
n=n.replace("9","1")
n=n.replace("X","9")
n=int(n)
print(n)

### FIXED CODE ###

n=input()
n=n.replace("1","X")
n=n.replace("9","1")
n=n.replace("X","9")
n=int(n)
print(n)