from math import gcd

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

res = 0

for i in range(N):
   res = gcd(res,A[i])

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

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

res = 0

for i in range(N):
   res = gcd(res,A[i])

print(res)