#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
g = 0
for i in range(n):
    g = gcd(g,A[i])
print(g) from fractions import gcd from itertools import combinations,permutations from collections import deque,defaultdict import sys sys sys.setrecursionlimit(10000000) sys.setrecursionlimit sys setrecursionlimit 10000000 mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 def readInts():
  return list(map(int,input().split())) readInts return list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def I():
  return int(input()) I return int(input()) int(input()) int input() input n = I() n I() I A = readInts() A readInts() readInts g = 0 g 0 for i in range(n):
    g = gcd(g,A[i]) i range(n) range n g = gcd(g,A[i]) g gcd(g,A[i]) gcd g A[i] A i print(g) print g g = 0 0 g g = gcd(g,A[i]) gcd(g,A[i]) g mod = 10**9 + 7 10**9 + 7 mod def readInts():
  return list(map(int,input().split())) def readInts():
  return list(map(int,input().split())) readInts n = I() I() n def I():
  return int(input()) def I():
  return int(input()) I A = readInts() readInts() A
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
g = 0
for i in range(n):
    g = gcd(g,A[i])
print(g)
