def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a%b)
N=int(input())
L=list(map(int,input().split()))
s=L[0]
for i in range(N-1):
  s=gcd(L[i+1],s)
print(s) def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a%b) gcd if b == 0:
    return a
  else:
    return gcd(b, a%b) b == 0 b 0 return a a return gcd(b, a%b) gcd(b, a%b) gcd b a%b a b a a b b N=int(input()) N int(input()) int input() input L=list(map(int,input().split())) L list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split s=L[0] s L[0] L 0 for i in range(N-1):
  s=gcd(L[i+1],s) i range(N-1) range N-1 N 1 s=gcd(L[i+1],s) s gcd(L[i+1],s) gcd L[i+1] L i+1 i 1 s print(s) print s def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a%b) def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a%b) gcd N=int(input()) int(input()) N L=list(map(int,input().split())) list(map(int,input().split())) L s=gcd(L[i+1],s) gcd(L[i+1],s) s s=L[0] L[0] s
def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a%b)
N=int(input())
L=list(map(int,input().split()))
s=L[0]
for i in range(N-1):
  s=gcd(L[i+1],s)
print(s)