import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from itertools import combinations, permutations, product
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x):
        self.setdefault(x,0)
        self[x] += 1

N,A = ilint()
# ans = A[0]
# for a in A[1:]:
#     ans = gcd(ans,a)
# print(ans)
from functools import reduce
def lgcd(l):
    return reduce(gcd, l)
print(lgcd(A)) import sys sys from sys import exit from collections import deque from bisect import bisect_left, bisect_right, insort_left, insort_right from heapq import heapify, heappop, heappush from itertools import combinations, permutations, product from math import * sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 INF = 10**20 INF 10**20 10 20 eps = 1.0e-20 eps 1.0e-20 MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 def lcm(x,y):
    return x*y//gcd(x,y) lcm return x*y//gcd(x,y) x*y//gcd(x,y) x*y x y gcd(x,y) gcd x y x x y y def mint():
    return map(int,input().split()) mint return map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split def lint():
    return list(map(int,input().split())) lint return list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def ilint():
    return int(input()), list(map(int,input().split())) ilint return int(input()), list(map(int,input().split())) return int(input()), list(map(int,input().split())) int(input()) int input() input list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1]) judge print(l[0] if x else l[1]) print l[0] if x else l[1] x l[0] l 0 l[1] l 1 x x l=['Yes', 'No'] l ['Yes', 'No'] 'Yes' 'No' def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep) lprint for x in l:
        print(x, end=sep) x l print(x, end=sep) print x end=sep end sep l l sep='\n' sep '\n' def ston(c, c0='a'):
    return ord(c)-ord(c0) ston return ord(c)-ord(c0) ord(c)-ord(c0) ord(c) ord c ord(c0) ord c0 c c c0='a' c0 'a' def ntos(x, c0='a'):
    return chr(x+ord(c0)) ntos return chr(x+ord(c0)) chr(x+ord(c0)) chr x+ord(c0) x ord(c0) ord c0 x x c0='a' c0 'a' class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x):
        self.setdefault(x,0)
        self[x] += 1 counter def __init__(self, *args):
        super().__init__(args)
     __init__ super().__init__(args) ().__init__ () super __init__ args self self *args def add(self,x):
        self.setdefault(x,0)
        self[x] += 1 add self.setdefault(x,0) self.setdefault self setdefault x 0 self[x] += 1 self[x] self x 1 self self x x dict N,A = ilint() N ilint() ilint A from functools import reduce def lgcd(l):
    return reduce(gcd, l) lgcd return reduce(gcd, l) reduce(gcd, l) reduce gcd l l l print(lgcd(A)) print lgcd(A) lgcd A def ston(c, c0='a'):
    return ord(c)-ord(c0) def ston(c, c0='a'):
    return ord(c)-ord(c0) ston def mint():
    return map(int,input().split()) def mint():
    return map(int,input().split()) mint N,A = ilint() ilint() N def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1]) def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1]) judge def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep) def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep) lprint A = ilint() ilint() A class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x):
        self.setdefault(x,0)
        self[x] += 1 class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x):
        self.setdefault(x,0)
        self[x] += 1 counter MOD = 10**9+7 10**9+7 MOD def ntos(x, c0='a'):
    return chr(x+ord(c0)) def ntos(x, c0='a'):
    return chr(x+ord(c0)) ntos INF = 10**20 10**20 INF def lcm(x,y):
    return x*y//gcd(x,y) def lcm(x,y):
    return x*y//gcd(x,y) lcm def lint():
    return list(map(int,input().split())) def lint():
    return list(map(int,input().split())) lint eps = 1.0e-20 1.0e-20 eps def ilint():
    return int(input()), list(map(int,input().split())) def ilint():
    return int(input()), list(map(int,input().split())) ilint def lgcd(l):
    return reduce(gcd, l) def lgcd(l):
    return reduce(gcd, l) lgcd
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from itertools import combinations, permutations, product
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x):
        self.setdefault(x,0)
        self[x] += 1

N,A = ilint()
# ans = A[0]
# for a in A[1:]:
#     ans = gcd(ans,a)
# print(ans)
from functools import reduce
def lgcd(l):
    return reduce(gcd, l)
print(lgcd(A))