import math

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

tmp = a[0]
for i in range(1,len(a)):
    tmp = math.gcd(tmp,a[i])
print(tmp) import math math n = int(input()) n int(input()) int input() input a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split tmp = a[0] tmp a[0] a 0 for i in range(1,len(a)):
    tmp = math.gcd(tmp,a[i]) i range(1,len(a)) range 1 len(a) len a tmp = math.gcd(tmp,a[i]) tmp math.gcd(tmp,a[i]) math.gcd math gcd tmp a[i] a i print(tmp) print tmp tmp = math.gcd(tmp,a[i]) math.gcd(tmp,a[i]) tmp n = int(input()) int(input()) n a = list(map(int,input().split())) list(map(int,input().split())) a tmp = a[0] a[0] tmp
import math

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

tmp = a[0]
for i in range(1,len(a)):
    tmp = math.gcd(tmp,a[i])
print(tmp)