import math

n = int(input())
a = list(map(int, input().split()))

ans = 10**10
for i in range(1, n):
    ans = min(ans, math.gcd(a[0], a[i]))
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 = 10**10 ans 10**10 10 10 for i in range(1, n):
    ans = min(ans, math.gcd(a[0], a[i])) i range(1, n) range 1 n ans = min(ans, math.gcd(a[0], a[i])) ans min(ans, math.gcd(a[0], a[i])) min ans math.gcd(a[0], a[i]) math.gcd math gcd a[0] a 0 a[i] a i print(ans) print ans n = int(input()) int(input()) n a = list(map(int, input().split())) list(map(int, input().split())) a ans = 10**10 10**10 ans ans = min(ans, math.gcd(a[0], a[i])) min(ans, math.gcd(a[0], a[i])) ans
import math

n = int(input())
a = list(map(int, input().split()))

ans = 10**10
for i in range(1, n):
    ans = min(ans, math.gcd(a[0], a[i]))
print(ans)