import sys
from fractions import gcd
# from heapq import heapify, heappop, heappush
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

g = a[0]
for i in range(1, n):
    g = gcd(g, a[i])
print(g)

# heapify(a)
# while len(a) != 1:
#     f = heappop(a)
#     s = heappop(a)
#     s %= f
#     if s != 0:
#         heappush(a, s)
#     heappush(a, f)
# print(heappop(a)) import sys sys from fractions import gcd sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline 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 g = a[0] g a[0] a 0 for i in range(1, n):
    g = gcd(g, a[i]) i range(1, n) range 1 n g = gcd(g, a[i]) g gcd(g, a[i]) gcd g a[i] a i print(g) print g n = int(input()) int(input()) n a = list(map(int, input().split())) list(map(int, input().split())) a g = a[0] a[0] g input = sys.stdin.readline sys.stdin.readline input g = gcd(g, a[i]) gcd(g, a[i]) g
import sys
from fractions import gcd
# from heapq import heapify, heappop, heappush
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

g = a[0]
for i in range(1, n):
    g = gcd(g, a[i])
print(g)

# heapify(a)
# while len(a) != 1:
#     f = heappop(a)
#     s = heappop(a)
#     s %= f
#     if s != 0:
#         heappush(a, s)
#     heappush(a, f)
# print(heappop(a))
