# ABC118C - Monsters Battle Royale

from fractions import gcd



n = int(eval(input()))

arr = list(map(int, input().rstrip().split()))

ans = arr[0]

for i in arr[1:]:

    ans = gcd(ans, i)

print(ans)
# ABC118C - Monsters Battle Royale

from functools import reduce

from fractions import gcd





def main():

    N, *A = list(map(int, open(0).read().split()))

    ans = reduce(gcd, A)

    print(ans)





if __name__ == "__main__":

    main()
# ABC118C - Monsters Battle Royale
from fractions import gcd

n = int(eval(input()))
arr = list(map(int, input().rstrip().split()))
ans = arr[0]
for i in arr[1:]:
    ans = gcd(ans, i)
print(ans)

# ABC118C - Monsters Battle Royale
from functools import reduce
from fractions import gcd


def main():
    N, *A = list(map(int, open(0).read().split()))
    ans = reduce(gcd, A)
    print(ans)


if __name__ == "__main__":
    main()

+from functools import reduce -n = int(eval(input())) -arr = list(map(int, input().rstrip().split())) -ans = arr[0] -for i in arr[1:]: -    ans = gcd(ans, i) -print(ans) + +def main(): +    N, *A = list(map(int, open(0).read().split())) +    ans = reduce(gcd, A) +    print(ans) + + +if __name__ == "__main__": +    main()