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