n=int(eval(input()))

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

m=min(l)

l2=[]

l3=[]

for i in range(1,int(m**(1/2)+1)):

  if m%i==0:                   

    l2.append(i)

    if i!=m//i:

      l2.append(m//i)

for i in l2:

  b=True

  for j in l:

    if j%i==0:

      pass

    else:

      b=False

  if b:

    l3.append(i)

print((max(l3)))
def gcd(n,m):

  a=min(n,m)

  b=max(n,m)

  while a!=0:

    b,a=a,b%a

  return b

n=int(eval(input()))

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

ans=l[0]

for i in range(1,n):

  ans=gcd(ans,l[i])

print(ans)
n = int(eval(input()))
l = sorted(list(map(int, input().split())))
m = min(l)
l2 = []
l3 = []
for i in range(1, int(m ** (1 / 2) + 1)):
    if m % i == 0:
        l2.append(i)
        if i != m // i:
            l2.append(m // i)
for i in l2:
    b = True
    for j in l:
        if j % i == 0:
            pass
        else:
            b = False
    if b:
        l3.append(i)
print((max(l3)))

def gcd(n, m):
    a = min(n, m)
    b = max(n, m)
    while a != 0:
        b, a = a, b % a
    return b


n = int(eval(input()))
l = list(map(int, input().split()))
ans = l[0]
for i in range(1, n):
    ans = gcd(ans, l[i])
print(ans)

+def gcd(n, m): +    a = min(n, m) +    b = max(n, m) +    while a != 0: +        b, a = a, b % a +    return b + + -l = sorted(list(map(int, input().split()))) -m = min(l) -l2 = [] -l3 = [] -for i in range(1, int(m ** (1 / 2) + 1)): -    if m % i == 0: -        l2.append(i) -        if i != m // i: -            l2.append(m // i) -for i in l2: -    b = True -    for j in l: -        if j % i == 0: -            pass -        else: -            b = False -    if b: -        l3.append(i) -print((max(l3))) +l = list(map(int, input().split())) +ans = l[0] +for i in range(1, n): +    ans = gcd(ans, l[i]) +print(ans)