from math import gcd
N = int(input())
A = list(map(int, input().split()))
k = 0
for i in A:
  k = gcd(i,k)
print(k) 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 k = 0 k 0 for i in A:
  k = gcd(i,k) i A k = gcd(i,k) k gcd(i,k) gcd i k print(k) print k k = gcd(i,k) gcd(i,k) k A = list(map(int, input().split())) list(map(int, input().split())) A N = int(input()) int(input()) N k = 0 0 k
from math import gcd
N = int(input())
A = list(map(int, input().split()))
k = 0
for i in A:
  k = gcd(i,k)
print(k)