import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A_l = LI()
ans = A_l[0]
for i in range(1, N):
    ans = math.gcd(ans, A_l[i])
print(ans) import bisect,collections,copy,heapq,itertools,math,string bisect collections copy heapq itertools math string import sys sys def S(): return sys.stdin.readline().rstrip() S def M(): return map(int,sys.stdin.readline().rstrip().split()) M def I(): return int(sys.stdin.readline().rstrip()) I def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def LS(): return list(sys.stdin.readline().rstrip().split()) LS N = I() N I() I A_l = LI() A_l LI() LI ans = A_l[0] ans A_l[0] A_l 0 for i in range(1, N):
    ans = math.gcd(ans, A_l[i]) i range(1, N) range 1 N ans = math.gcd(ans, A_l[i]) ans math.gcd(ans, A_l[i]) math.gcd math gcd ans A_l[i] A_l i print(ans) print ans N = I() I() N ans = A_l[0] A_l[0] ans ans = math.gcd(ans, A_l[i]) math.gcd(ans, A_l[i]) ans def M(): return map(int,sys.stdin.readline().rstrip().split()) def M(): return map(int,sys.stdin.readline().rstrip().split()) M A_l = LI() LI() A_l def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I def LS(): return list(sys.stdin.readline().rstrip().split()) def LS(): return list(sys.stdin.readline().rstrip().split()) LS def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A_l = LI()
ans = A_l[0]
for i in range(1, N):
    ans = math.gcd(ans, A_l[i])
print(ans)