import fractions
n = int(input())
li = list(map(int,input().split()))
gcd1 = 0
gcd1 = fractions.gcd(li[0],li[1])
for i in range(2,n):
    gcd1 = fractions.gcd(gcd1,li[i])
print(gcd1) import fractions fractions n = int(input()) n int(input()) int input() input li = list(map(int,input().split())) li list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split gcd1 = 0 gcd1 0 gcd1 = fractions.gcd(li[0],li[1]) gcd1 fractions.gcd(li[0],li[1]) fractions.gcd fractions gcd li[0] li 0 li[1] li 1 for i in range(2,n):
    gcd1 = fractions.gcd(gcd1,li[i]) i range(2,n) range 2 n gcd1 = fractions.gcd(gcd1,li[i]) gcd1 fractions.gcd(gcd1,li[i]) fractions.gcd fractions gcd gcd1 li[i] li i print(gcd1) print gcd1 gcd1 = 0 0 gcd1 gcd1 = fractions.gcd(li[0],li[1]) fractions.gcd(li[0],li[1]) gcd1 n = int(input()) int(input()) n li = list(map(int,input().split())) list(map(int,input().split())) li gcd1 = fractions.gcd(gcd1,li[i]) fractions.gcd(gcd1,li[i]) gcd1
import fractions
n = int(input())
li = list(map(int,input().split()))
gcd1 = 0
gcd1 = fractions.gcd(li[0],li[1])
for i in range(2,n):
    gcd1 = fractions.gcd(gcd1,li[i])
print(gcd1)