def gcd(a,b):

  if min(a,b)==a:

    if b%a==0:return a

    else:b%=a

  while 1:

    if a%b==0:break

    a%=b

    if b%a==0:break

    b%=a

  return min(a,b)

n=int(eval(input()))

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

for oAo in range(len(a)-1):

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

  del a[1]

print((a[0]))
def gcd(a,b):

  while b:a,b=b,a%b

  return a

n=int(eval(input()))

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

ans=a[0]

for i in a[1:]:ans=gcd(ans,i)

print(ans)
def gcd(a, b):
    if min(a, b) == a:
        if b % a == 0:
            return a
        else:
            b %= a
    while 1:
        if a % b == 0:
            break
        a %= b
        if b % a == 0:
            break
        b %= a
    return min(a, b)


n = int(eval(input()))
a = list(map(int, input().split()))
for oAo in range(len(a) - 1):
    a[0] = gcd(a[0], a[1])
    del a[1]
print((a[0]))

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


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

-    if min(a, b) == a: -        if b % a == 0: -            return a -        else: -            b %= a -    while 1: -        if a % b == 0: -            break -        a %= b -        if b % a == 0: -            break -        b %= a -    return min(a, b) +    while b: +        a, b = b, a % b +    return a -for oAo in range(len(a) - 1): -    a[0] = gcd(a[0], a[1]) -    del a[1] -print((a[0])) +ans = a[0] +for i in a[1:]: +    ans = gcd(ans, i) +print(ans)