import math

n = int(input())
A = list(map(int,input().split()))

ans = math.gcd(A[0],A[1])
for i in range(2,n):
    ans = math.gcd(ans, A[i])
    
print(ans) import math math 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 ans = math.gcd(A[0],A[1]) ans math.gcd(A[0],A[1]) math.gcd math gcd A[0] A 0 A[1] A 1 for i in range(2,n):
    ans = math.gcd(ans, A[i])
     i range(2,n) range 2 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 ans = math.gcd(A[0],A[1]) math.gcd(A[0],A[1]) ans A = list(map(int,input().split())) list(map(int,input().split())) A n = int(input()) int(input()) n ans = math.gcd(ans, A[i]) math.gcd(ans, A[i]) ans
import math

n = int(input())
A = list(map(int,input().split()))

ans = math.gcd(A[0],A[1])
for i in range(2,n):
    ans = math.gcd(ans, A[i])
    
print(ans)