def gcd(a, b):

  while b > 0:

    a, b = b, a%b

  return a



n = int(eval(input()))

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

if len(enemy)==1:

    print((enemy[0]))

else:

    enemy.sort()

    min_n = 10**10

    for i in range(len(enemy)-1):

        min_n = min(min_n,gcd(enemy[i],enemy[i+1]))

    print(min_n)
def gcd(x,y):

    if x%y==0: return y

    else: return gcd(y,x%y)

n = int(eval(input()))

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

a.sort()

ans = a[0]

for i in range(1,n):

    ans = min(ans,gcd(ans,a[i]))

print(ans)
def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a


n = int(eval(input()))
enemy = list(set(map(int, input().split())))
if len(enemy) == 1:
    print((enemy[0]))
else:
    enemy.sort()
    min_n = 10**10
    for i in range(len(enemy) - 1):
        min_n = min(min_n, gcd(enemy[i], enemy[i + 1]))
    print(min_n)

def gcd(x, y):
    if x % y == 0:
        return y
    else:
        return gcd(y, x % y)


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

-def gcd(a, b): -    while b > 0: -        a, b = b, a % b -    return a +def gcd(x, y): +    if x % y == 0: +        return y +    else: +        return gcd(y, x % y) -enemy = list(set(map(int, input().split()))) -if len(enemy) == 1: -    print((enemy[0])) -else: -    enemy.sort() -    min_n = 10**10 -    for i in range(len(enemy) - 1): -        min_n = min(min_n, gcd(enemy[i], enemy[i + 1])) -    print(min_n) +a = list(map(int, input().split())) +a.sort() +ans = a[0] +for i in range(1, n): +    ans = min(ans, gcd(ans, a[i])) +print(ans)