import math

N = int(input())
A = list(map(int, input().split()))
ans = A[0]

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

N = int(input())
A = list(map(int, input().split()))
ans = A[0]

for a in A[1:]:
    ans = math.gcd(ans, a)
print(ans)