import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

p=gcd_list(a)

print(p)

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

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

p=gcd_list(a)

print(p)


