# ABC 118 C



import fractions



N = int(eval(input()))



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



g = a[0]



for i in a:

    g = fractions.gcd(g, i)



print(g)

def gcd(x, y):

  if y == 0:

    return x

  else:

    return gcd(y, x % y)



def resolve():

  n = int(eval(input()))

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

  ans = a[0]

  for x in a:

    ans = gcd(ans, x)



  print(ans)

  return



if __name__ == "__main__":

  resolve()

# ABC 118 C
import fractions

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

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


def resolve():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    ans = a[0]
    for x in a:
        ans = gcd(ans, x)
    print(ans)
    return


if __name__ == "__main__":
    resolve()

-# ABC 118 C -import fractions +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())) -g = a[0] -for i in a: -    g = fractions.gcd(g, i) -print(g) + +def resolve(): +    n = int(eval(input())) +    a = list(map(int, input().split())) +    ans = a[0] +    for x in a: +        ans = gcd(ans, x) +    print(ans) +    return + + +if __name__ == "__main__": +    resolve()