def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b)

def gcd(l):
    ans = l[0]
    for i in l:  ans = gcd_(ans, i)
    return ans

N = int(input())
print(gcd(list(map(int,input().split())))) def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b) gcd_ if a < b:  a, b = b, a
     a < b a b if b == 0:  return a
     b == 0 b 0 return gcd_(b, a % b) gcd_(b, a % b) gcd_ b a % b a b a a b b def gcd(l):
    ans = l[0]
    for i in l:  ans = gcd_(ans, i)
    return ans gcd ans = l[0] ans l[0] l 0 for i in l:  ans = gcd_(ans, i)
     i l return ans ans l l N = int(input()) N int(input()) int input() input print(gcd(list(map(int,input().split())))) print gcd(list(map(int,input().split()))) gcd list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split N = int(input()) int(input()) N def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b) def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b) gcd_ def gcd(l):
    ans = l[0]
    for i in l:  ans = gcd_(ans, i)
    return ans def gcd(l):
    ans = l[0]
    for i in l:  ans = gcd_(ans, i)
    return ans gcd
def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b)

def gcd(l):
    ans = l[0]
    for i in l:  ans = gcd_(ans, i)
    return ans

N = int(input())
print(gcd(list(map(int,input().split()))))