# 解説確認後

import fractions #val 3.4

N = int(input())

a = list(map(int,input().split()))

gcd = fractions.gcd(a[0],a[1])

for i in range(2,N):
    gcd = fractions.gcd(a[i],gcd)
print(gcd) import fractions fractions 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 gcd = fractions.gcd(a[0],a[1]) gcd fractions.gcd(a[0],a[1]) fractions.gcd fractions gcd a[0] a 0 a[1] a 1 for i in range(2,N):
    gcd = fractions.gcd(a[i],gcd) i range(2,N) range 2 N gcd = fractions.gcd(a[i],gcd) gcd fractions.gcd(a[i],gcd) fractions.gcd fractions gcd a[i] a i gcd print(gcd) print gcd N = int(input()) int(input()) N a = list(map(int,input().split())) list(map(int,input().split())) a gcd = fractions.gcd(a[0],a[1]) fractions.gcd(a[0],a[1]) gcd gcd = fractions.gcd(a[i],gcd) fractions.gcd(a[i],gcd) gcd
# 解説確認後

import fractions #val 3.4

N = int(input())

a = list(map(int,input().split()))

gcd = fractions.gcd(a[0],a[1])

for i in range(2,N):
    gcd = fractions.gcd(a[i],gcd)
print(gcd)