import fractions

n = int(eval(input()))

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

d = a[0]

for t in a:

  d = fractions.gcd(d, t)

print(d)
import fractions

n = int(eval(input()))

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

d = min(a)

for t in a:

  d = fractions.gcd(d, t)

print(d)
import fractions

n = int(eval(input()))
a = list(map(int, input().split()))
d = a[0]
for t in a:
    d = fractions.gcd(d, t)
print(d)

import fractions

n = int(eval(input()))
a = list(map(int, input().split()))
d = min(a)
for t in a:
    d = fractions.gcd(d, t)
print(d)

-d = a[0] +d = min(a)