import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0

N = i()
A = l()
ans = A[0]
for i in range(1,N):
    ans = math.gcd(ans,A[i])

print(ans) import sys sys import math math import itertools itertools import bisect bisect from copy import copy from collections import deque,Counter from decimal import Decimal def s(): return input() s def i(): return int(input()) i def S(): return input().split() S def I(): return map(int,input().split()) I def X(): return list(input()) X def L(): return list(input().split()) L def l(): return list(map(int,input().split())) l def lcm(a,b): return a*b//math.gcd(a,b) lcm a a b b def gcd(*numbers): reduce(math.gcd, numbers) gcd *numbers sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 count = 0 count 0 N = i() N i() i A = l() A l() l ans = A[0] ans A[0] A 0 for i in range(1,N):
    ans = math.gcd(ans,A[i]) i range(1,N) range 1 N ans = math.gcd(ans,A[i]) ans math.gcd(ans,A[i]) math.gcd math gcd ans A[i] A i print(ans) print ans def X(): return list(input()) def X(): return list(input()) X ans = math.gcd(ans,A[i]) math.gcd(ans,A[i]) ans def lcm(a,b): return a*b//math.gcd(a,b) def lcm(a,b): return a*b//math.gcd(a,b) lcm count = 0 0 count A = l() l() A def S(): return input().split() def S(): return input().split() S def gcd(*numbers): reduce(math.gcd, numbers) def gcd(*numbers): reduce(math.gcd, numbers) gcd def I(): return map(int,input().split()) def I(): return map(int,input().split()) I def i(): return int(input()) def i(): return int(input()) i def l(): return list(map(int,input().split())) def l(): return list(map(int,input().split())) l N = i() i() N ans = A[0] A[0] ans def L(): return list(input().split()) def L(): return list(input().split()) L def s(): return input() def s(): return input() s mod = 10**9+7 10**9+7 mod
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0

N = i()
A = l()
ans = A[0]
for i in range(1,N):
    ans = math.gcd(ans,A[i])

print(ans)
