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