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