def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

from collections import deque
N = INT()
A = LI()
A.sort()

while True:
    mod = A[0]
    flg = True
    ans = A[0]
    tmp = deque([A[0]])
    
    if ans == 1:
        print(ans)
        break
    
    for i in range(1, len(A)):
        A[i] %= mod

        if A[i] != 0 and flg:
            flg = False
        
        if A[i] == 0:
            continue
        tmp.append(A[i])
        
    if flg:
        print(ans)
        break
    
    A = sorted(tmp) def INT():
    return int(input()) INT return int(input()) int(input()) int input() input def MI():
    return map(int, input().split()) MI return map(int, input().split()) map(int, input().split()) map int input().split() ().split () input split def LI():
    return list(map(int, input().split())) LI return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split from collections import deque N = INT() N INT() INT A = LI() A LI() LI A.sort() A.sort A sort while True:
    mod = A[0]
    flg = True
    ans = A[0]
    tmp = deque([A[0]])
    
    if ans == 1:
        print(ans)
        break
    
    for i in range(1, len(A)):
        A[i] %= mod

        if A[i] != 0 and flg:
            flg = False
        
        if A[i] == 0:
            continue
        tmp.append(A[i])
        
    if flg:
        print(ans)
        break
    
    A = sorted(tmp) True mod = A[0] mod A[0] A 0 flg = True flg True ans = A[0] ans A[0] A 0 tmp = deque([A[0]]) tmp deque([A[0]]) deque [A[0]] A[0] A 0 if ans == 1:
        print(ans)
        break
    
     ans == 1 ans 1 print(ans) print ans break for i in range(1, len(A)):
        A[i] %= mod

        if A[i] != 0 and flg:
            flg = False
        
        if A[i] == 0:
            continue
        tmp.append(A[i])
        
     i range(1, len(A)) range 1 len(A) len A A[i] %= mod A[i] A i mod if A[i] != 0 and flg:
            flg = False
        
         A[i] != 0 and flg A[i] != 0 A[i] A i 0 flg flg = False flg False if A[i] == 0:
            continue
         A[i] == 0 A[i] A i 0 continue tmp.append(A[i]) tmp.append tmp append A[i] A i if flg:
        print(ans)
        break
    
     flg print(ans) print ans break A = sorted(tmp) A sorted(tmp) sorted tmp A = sorted(tmp) sorted(tmp) A flg = True True flg def LI():
    return list(map(int, input().split())) def LI():
    return list(map(int, input().split())) LI A = LI() LI() A mod = A[0] A[0] mod ans = A[0] A[0] ans tmp = deque([A[0]]) deque([A[0]]) tmp N = INT() INT() N flg = False False flg def INT():
    return int(input()) def INT():
    return int(input()) INT def MI():
    return map(int, input().split()) def MI():
    return map(int, input().split()) MI
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

from collections import deque
N = INT()
A = LI()
A.sort()

while True:
    mod = A[0]
    flg = True
    ans = A[0]
    tmp = deque([A[0]])
    
    if ans == 1:
        print(ans)
        break
    
    for i in range(1, len(A)):
        A[i] %= mod

        if A[i] != 0 and flg:
            flg = False
        
        if A[i] == 0:
            continue
        tmp.append(A[i])
        
    if flg:
        print(ans)
        break
    
    A = sorted(tmp)