import math
N = int(input())
A = list(map(int, input().split()))
g = math.gcd(A[0],A[1])
for i in range(2,N):
    g = math.gcd(g,A[i])
print(g)     import math math 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 g = math.gcd(A[0],A[1]) g math.gcd(A[0],A[1]) math.gcd math gcd A[0] A 0 A[1] A 1 for i in range(2,N):
    g = math.gcd(g,A[i]) i range(2,N) range 2 N g = math.gcd(g,A[i]) g math.gcd(g,A[i]) math.gcd math gcd g A[i] A i print(g) print g g = math.gcd(g,A[i]) math.gcd(g,A[i]) g N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A g = math.gcd(A[0],A[1]) math.gcd(A[0],A[1]) g
import math
N = int(input())
A = list(map(int, input().split()))
g = math.gcd(A[0],A[1])
for i in range(2,N):
    g = math.gcd(g,A[i])
print(g)    