import math

def solve():
    ans = A[0]
    for i in range(1, N):  
        ans = math.gcd(ans, A[i])
    print(ans)

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    solve()   import math math def solve():
    ans = A[0]
    for i in range(1, N):  
        ans = math.gcd(ans, A[i])
    print(ans) solve ans = A[0] ans A[0] A 0 for i in range(1, N):  
        ans = math.gcd(ans, A[i])
     i range(1, N) range 1 N ans = math.gcd(ans, A[i]) ans math.gcd(ans, A[i]) math.gcd math gcd ans A[i] A i print(ans) print ans if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    solve()   __name__ == "__main__" __name__ "__main__" N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split solve() solve A = list(map(int, input().split())) list(map(int, input().split())) A def solve():
    ans = A[0]
    for i in range(1, N):  
        ans = math.gcd(ans, A[i])
    print(ans) def solve():
    ans = A[0]
    for i in range(1, N):  
        ans = math.gcd(ans, A[i])
    print(ans) solve N = int(input()) int(input()) N
import math

def solve():
    ans = A[0]
    for i in range(1, N):  
        ans = math.gcd(ans, A[i])
    print(ans)

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    solve()  
