import math
N = int(input())
A = list(map(lambda a: int(a), input().split(" ")))

gcd = A[0]
for i in range(len(A)):
  gcd = math.gcd(gcd, A[i])
  
print(gcd) import math math N = int(input()) N int(input()) int input() input A = list(map(lambda a: int(a), input().split(" "))) A list(map(lambda a: int(a), input().split(" "))) list map(lambda a: int(a), input().split(" ")) map lambda a: int(a) int(a) int a a input().split(" ") ().split () input split " " gcd = A[0] gcd A[0] A 0 for i in range(len(A)):
  gcd = math.gcd(gcd, A[i])
   i range(len(A)) range len(A) len A gcd = math.gcd(gcd, A[i]) gcd math.gcd(gcd, A[i]) math.gcd math gcd gcd A[i] A i print(gcd) print gcd N = int(input()) int(input()) N A = list(map(lambda a: int(a), input().split(" "))) list(map(lambda a: int(a), input().split(" "))) A gcd = math.gcd(gcd, A[i]) math.gcd(gcd, A[i]) gcd gcd = A[0] A[0] gcd
import math
N = int(input())
A = list(map(lambda a: int(a), input().split(" ")))

gcd = A[0]
for i in range(len(A)):
  gcd = math.gcd(gcd, A[i])
  
print(gcd)
