import fractions
n=int(input())
n=list(map(int,input().split()))
p=n[0]
for x in n:
    p=fractions.gcd(p,x)
print(p) import fractions fractions n=int(input()) n int(input()) int input() input n=list(map(int,input().split())) n list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split p=n[0] p n[0] n 0 for x in n:
    p=fractions.gcd(p,x) x n p=fractions.gcd(p,x) p fractions.gcd(p,x) fractions.gcd fractions gcd p x print(p) print p p=n[0] n[0] p n=list(map(int,input().split())) list(map(int,input().split())) n n=int(input()) int(input()) n p=fractions.gcd(p,x) fractions.gcd(p,x) p
import fractions
n=int(input())
n=list(map(int,input().split()))
p=n[0]
for x in n:
    p=fractions.gcd(p,x)
print(p)