import fractions 
n = int(input())
H = list(map(int,input().split()))
num = fractions.gcd(H[0],H[1])
for i in range(2,n-2):
  num = fractions.gcd(num,H[i])
print(num) import fractions fractions n = int(input()) n int(input()) int input() input H = list(map(int,input().split())) H list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split num = fractions.gcd(H[0],H[1]) num fractions.gcd(H[0],H[1]) fractions.gcd fractions gcd H[0] H 0 H[1] H 1 for i in range(2,n-2):
  num = fractions.gcd(num,H[i]) i range(2,n-2) range 2 n-2 n 2 num = fractions.gcd(num,H[i]) num fractions.gcd(num,H[i]) fractions.gcd fractions gcd num H[i] H i print(num) print num n = int(input()) int(input()) n H = list(map(int,input().split())) list(map(int,input().split())) H num = fractions.gcd(num,H[i]) fractions.gcd(num,H[i]) num num = fractions.gcd(H[0],H[1]) fractions.gcd(H[0],H[1]) num
import fractions 
n = int(input())
H = list(map(int,input().split()))
num = fractions.gcd(H[0],H[1])
for i in range(2,n-2):
  num = fractions.gcd(num,H[i])
print(num)