def gcd(x,y):

  if y==0:

    return x

  else:

    return gcd(y,x%y)



n=int(eval(input()))

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

a=list(sorted(a))



g=a[0]

for aa in a:

  g=gcd(g,aa)

print(g)

def gcd(x, y):

    if y == 0: return x

    return gcd(y, x % y)





N = int(eval(input()))

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



g = a[0]

for aa in a:

    g = gcd(g, aa)

print(g)

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


n = int(eval(input()))
a = list(map(int, input().split()))
a = list(sorted(a))
g = a[0]
for aa in a:
    g = gcd(g, aa)
print(g)

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


N = int(eval(input()))
a = list(map(int, input().split()))
g = a[0]
for aa in a:
    g = gcd(g, aa)
print(g)

-    else: -        return gcd(y, x % y) +    return gcd(y, x % y) -n = int(eval(input())) +N = int(eval(input())) -a = list(sorted(a))