n=int(eval(input()))

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



def gcd(a,b):

    while(a%b!=0):

        a,b=b,a%b

    return b

a=list(sorted(a))

c=gcd(a[0],a[1])

for i in range(2,n):

    c=gcd(a[i],c)

print(c)

import sys

input=sys.stdin.buffer.readline

from math import*



n=int(eval(input()))

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

ans=1

if n>2:

	ans=gcd(arr[0],arr[1])

	for i in range(2,n):

		ans=gcd(ans,arr[i])

else:

	ans=gcd(arr[0],arr[1])

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))


def gcd(a, b):
    while a % b != 0:
        a, b = b, a % b
    return b


a = list(sorted(a))
c = gcd(a[0], a[1])
for i in range(2, n):
    c = gcd(a[i], c)
print(c)

import sys

input = sys.stdin.buffer.readline
from math import *

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

+import sys + +input = sys.stdin.buffer.readline +from math import * + -a = list(map(int, input().split())) - - -def gcd(a, b): -    while a % b != 0: -        a, b = b, a % b -    return b - - -a = list(sorted(a)) -c = gcd(a[0], a[1]) -for i in range(2, n): -    c = gcd(a[i], c) -print(c) +arr = list(map(int, input().split())) +ans = 1 +if n > 2: +    ans = gcd(arr[0], arr[1]) +    for i in range(2, n): +        ans = gcd(ans, arr[i]) +else: +    ans = gcd(arr[0], arr[1]) +print(ans)