import fractions
from functools import reduce
n=int(input())
A=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(fractions.gcd,numbers)
print(gcd(*A)) import fractions fractions from functools import reduce 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 def gcd(*numbers):
    return reduce(fractions.gcd,numbers) gcd return reduce(fractions.gcd,numbers) reduce(fractions.gcd,numbers) reduce fractions.gcd fractions gcd numbers *numbers print(gcd(*A)) print gcd(*A) gcd *A A def gcd(*numbers):
    return reduce(fractions.gcd,numbers) def gcd(*numbers):
    return reduce(fractions.gcd,numbers) gcd A=list(map(int,input().split())) list(map(int,input().split())) A n=int(input()) int(input()) n
import fractions
from functools import reduce
n=int(input())
A=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(fractions.gcd,numbers)
print(gcd(*A))
