import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    from functools import reduce
    def gcd(*numbers):
        return reduce(math.gcd, numbers)
    n = I()
    lst = LI()
    ans = gcd(*lst)
    print(ans)
main()             import bisect,collections,copy,itertools,math,string bisect collections copy itertools math string import sys sys def I(): return int(sys.stdin.readline().rstrip()) I def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def S(): return sys.stdin.readline().rstrip() S def LS(): return list(sys.stdin.readline().rstrip().split()) LS def main():
    from functools import reduce
    def gcd(*numbers):
        return reduce(math.gcd, numbers)
    n = I()
    lst = LI()
    ans = gcd(*lst)
    print(ans) main from functools import reduce def gcd(*numbers):
        return reduce(math.gcd, numbers)
     gcd return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers *numbers n = I() n I() I lst = LI() lst LI() LI ans = gcd(*lst) ans gcd(*lst) gcd *lst lst print(ans) print ans main() main def LS(): return list(sys.stdin.readline().rstrip().split()) def LS(): return list(sys.stdin.readline().rstrip().split()) LS def main():
    from functools import reduce
    def gcd(*numbers):
        return reduce(math.gcd, numbers)
    n = I()
    lst = LI()
    ans = gcd(*lst)
    print(ans) def main():
    from functools import reduce
    def gcd(*numbers):
        return reduce(math.gcd, numbers)
    n = I()
    lst = LI()
    ans = gcd(*lst)
    print(ans) main def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    from functools import reduce
    def gcd(*numbers):
        return reduce(math.gcd, numbers)
    n = I()
    lst = LI()
    ans = gcd(*lst)
    print(ans)
main()            
