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