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