from fractions import gcd
n=int(input())
l=list(map(int,input().split()))
s=l[0]
for a in l[1:]:
    s=gcd(s,a)
print(s) from fractions import gcd 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 a in l[1:]:
    s=gcd(s,a) a l[1:] l 1: 1 s=gcd(s,a) s gcd(s,a) gcd s a print(s) print s s=gcd(s,a) gcd(s,a) s l=list(map(int,input().split())) list(map(int,input().split())) l n=int(input()) int(input()) n s=l[0] l[0] s
from fractions import gcd
n=int(input())
l=list(map(int,input().split()))
s=l[0]
for a in l[1:]:
    s=gcd(s,a)
print(s)
