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


n = int(input())
l = list(map(int,input().split()))
l.sort()

tmp = gcd(l[0],l[1])
for i in range(2,len(l)):
    tmp = gcd(tmp,l[i])

print(tmp) def gcd(a,b):
 while b!=0:
   a,b=b,a%b
 return a gcd while b!=0:
   a,b=b,a%b
  b!=0 b 0 a,b=b,a%b a b b a%b a b return a a 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 l.sort() l.sort l sort tmp = gcd(l[0],l[1]) tmp gcd(l[0],l[1]) gcd l[0] l 0 l[1] l 1 for i in range(2,len(l)):
    tmp = gcd(tmp,l[i]) i range(2,len(l)) range 2 len(l) len l tmp = gcd(tmp,l[i]) tmp gcd(tmp,l[i]) gcd tmp l[i] l i print(tmp) print tmp tmp = gcd(tmp,l[i]) gcd(tmp,l[i]) tmp n = int(input()) int(input()) n def gcd(a,b):
 while b!=0:
   a,b=b,a%b
 return a def gcd(a,b):
 while b!=0:
   a,b=b,a%b
 return a gcd l = list(map(int,input().split())) list(map(int,input().split())) l tmp = gcd(l[0],l[1]) gcd(l[0],l[1]) tmp
def gcd(a,b):
 while b!=0:
   a,b=b,a%b
 return a


n = int(input())
l = list(map(int,input().split()))
l.sort()

tmp = gcd(l[0],l[1])
for i in range(2,len(l)):
    tmp = gcd(tmp,l[i])

print(tmp)