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

a.sort()

mini = a.pop(0)
ans = 10**9+1
for i in range(n-1):
  temp = fractions.gcd(mini, a[i])
  if temp < ans:
    ans = temp
  
print(ans) import fractions fractions 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 a.sort() a.sort a sort mini = a.pop(0) mini a.pop(0) a.pop a pop 0 ans = 10**9+1 ans 10**9+1 10**9 10 9 1 for i in range(n-1):
  temp = fractions.gcd(mini, a[i])
  if temp < ans:
    ans = temp
   i range(n-1) range n-1 n 1 temp = fractions.gcd(mini, a[i]) temp fractions.gcd(mini, a[i]) fractions.gcd fractions gcd mini a[i] a i if temp < ans:
    ans = temp
   temp < ans temp ans ans = temp ans temp print(ans) print ans ans = 10**9+1 10**9+1 ans a = list(map(int, input().split())) list(map(int, input().split())) a n = int(input()) int(input()) n temp = fractions.gcd(mini, a[i]) fractions.gcd(mini, a[i]) temp ans = temp temp ans mini = a.pop(0) a.pop(0) mini
import fractions
n = int(input())
a = list(map(int, input().split()))

a.sort()

mini = a.pop(0)
ans = 10**9+1
for i in range(n-1):
  temp = fractions.gcd(mini, a[i])
  if temp < ans:
    ans = temp
  
print(ans)