#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b

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

def main():
    N = int(input())
    A = list(map(int, input().split()))

    print(gcd(*A))

if __name__ == '__main__':
    main() import sys sys import math math import decimal decimal import itertools itertools from itertools import product from functools import reduce def input():
    return sys.stdin.readline()[:-1] input return sys.stdin.readline()[:-1] sys.stdin.readline()[:-1] sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline :-1 -1 def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b sort_zip z = zip(a, b) z zip(a, b) zip a b z = sorted(z) z sorted(z) sorted z a, b = zip(*z) a zip(*z) zip *z z b a = list(a) a list(a) list a b = list(b) b list(b) list b return a, b return a, b a b a:list a b:list b 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 def main():
    N = int(input())
    A = list(map(int, input().split()))

    print(gcd(*A)) main 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 print(gcd(*A)) print gcd(*A) gcd *A A if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def input():
    return sys.stdin.readline()[:-1] def input():
    return sys.stdin.readline()[:-1] input def gcd(*numbers):
    return reduce(math.gcd, numbers) def gcd(*numbers):
    return reduce(math.gcd, numbers) gcd def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b sort_zip def main():
    N = int(input())
    A = list(map(int, input().split()))

    print(gcd(*A)) def main():
    N = int(input())
    A = list(map(int, input().split()))

    print(gcd(*A)) main
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b

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

def main():
    N = int(input())
    A = list(map(int, input().split()))

    print(gcd(*A))

if __name__ == '__main__':
    main()
