from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
A.sort()
T = [A[0]]
for i in range(1,len(A)):
  if A[i]//A[0] != 0:
    T.append(A[i])
  else:
    pass

ans = A[0]
for i in range(len(T)):
  ans = gcd(ans,T[i])
print(ans) from fractions import gcd 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 A.sort() A.sort A sort T = [A[0]] T [A[0]] A[0] A 0 for i in range(1,len(A)):
  if A[i]//A[0] != 0:
    T.append(A[i])
  else:
    pass i range(1,len(A)) range 1 len(A) len A if A[i]//A[0] != 0:
    T.append(A[i])
  else:
    pass A[i]//A[0] != 0 A[i]//A[0] A[i] A i A[0] A 0 0 T.append(A[i]) T.append T append A[i] A i ans = A[0] ans A[0] A 0 for i in range(len(T)):
  ans = gcd(ans,T[i]) i range(len(T)) range len(T) len T ans = gcd(ans,T[i]) ans gcd(ans,T[i]) gcd ans T[i] T i print(ans) print ans ans = A[0] A[0] ans A = list(map(int, input().split())) list(map(int, input().split())) A T = [A[0]] [A[0]] T ans = gcd(ans,T[i]) gcd(ans,T[i]) ans N = int(input()) int(input()) N
from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
A.sort()
T = [A[0]]
for i in range(1,len(A)):
  if A[i]//A[0] != 0:
    T.append(A[i])
  else:
    pass

ans = A[0]
for i in range(len(T)):
  ans = gcd(ans,T[i])
print(ans)