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