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