import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)
def gcd(x,y):
    if(x<y):
        x,y=y,x
    if(y==0):
        return x
    return gcd(y,x%y)

n=l()[0]
A=l()
ans=A[0]
for i in range(1,n):
    ans=gcd(ans,A[i])
print(ans) import sys sys from functools import lru_cache, cmp_to_key from heapq import merge, heapify, heappop, heappush from math import * from collections import defaultdict as dd, deque, Counter as C from itertools import combinations as comb, permutations as perm from bisect import bisect_left as bl, bisect_right as br, bisect from time import perf_counter from fractions import Fraction mod = int(pow(10, 9) + 7) mod int(pow(10, 9) + 7) int pow(10, 9) + 7 pow(10, 9) pow 10 9 7 mod2 = 998244353 mod2 998244353 def data(): return sys.stdin.readline().strip() data def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end) out end="\n" end "\n" *var def l(): return list(sp()) l def sl(): return list(ssp()) sl def sp(): return map(int, data().split()) sp def ssp(): return map(str, data().split()) ssp val for i in range(n) for i in range(n) i range(n) range n for i in range(n) val def l1d(n, val=0): return [val for i in range(n)] l1d n n val=0 val 0 l1d(n, val) for j in range(m) for j in range(m) j range(m) range m for j in range(m) l1d(n, val) l1d n val def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None) l2d n n m m val=0 val 0 def gcd(x,y):
    if(x<y):
        x,y=y,x
    if(y==0):
        return x
    return gcd(y,x%y) gcd if(x<y):
        x,y=y,x
     x<y x y x,y=y,x x y y x if(y==0):
        return x
     y==0 y 0 return x x return gcd(y,x%y) gcd(y,x%y) gcd y x%y x y x x y y n=l()[0] n l()[0] () l 0 A=l() A l() l ans=A[0] ans A[0] A 0 for i in range(1,n):
    ans=gcd(ans,A[i]) i range(1,n) range 1 n ans=gcd(ans,A[i]) ans gcd(ans,A[i]) gcd ans A[i] A i print(ans) print ans def data(): return sys.stdin.readline().strip() def data(): return sys.stdin.readline().strip() data def l1d(n, val=0): return [val for i in range(n)] def l1d(n, val=0): return [val for i in range(n)] l1d def l(): return list(sp()) def l(): return list(sp()) l n=l()[0] l()[0] n def sp(): return map(int, data().split()) def sp(): return map(int, data().split()) sp A=l() l() A def ssp(): return map(str, data().split()) def ssp(): return map(str, data().split()) ssp def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end) def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end) out mod2 = 998244353 998244353 mod2 def gcd(x,y):
    if(x<y):
        x,y=y,x
    if(y==0):
        return x
    return gcd(y,x%y) def gcd(x,y):
    if(x<y):
        x,y=y,x
    if(y==0):
        return x
    return gcd(y,x%y) gcd ans=gcd(ans,A[i]) gcd(ans,A[i]) ans def sl(): return list(ssp()) def sl(): return list(ssp()) sl ans=A[0] A[0] ans mod = int(pow(10, 9) + 7) int(pow(10, 9) + 7) mod def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None) def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None) l2d
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)
def gcd(x,y):
    if(x<y):
        x,y=y,x
    if(y==0):
        return x
    return gcd(y,x%y)

n=l()[0]
A=l()
ans=A[0]
for i in range(1,n):
    ans=gcd(ans,A[i])
print(ans)
