read N
read -a A

if [ ${#A[@]} -eq 2 ]; then
  if [ ${A[0]} -lt ${A[1]} ]; then
    echo ${A[1]}
  else
    echo ${A[0]}
  fi
  exit
fi

min=10000000000
most_least=$min
pre_least=$min
for i in `seq 0 $(( N - 1 ))`; do
  if [ ${A[$i]} -lt $min ]; then
    min=${A[$i]}
  fi
done

for i in `seq 0 $(( N - 1 ))`; do
  m=${A[$i]}
  n=$min
while [ $((m % 2)) -ne 0  -a $((n % 2)) -ne 0 ]; do
    m=$(( m>>1 ))
    n=$(( n>>1 ))
  done 
  while [ $n -ne 0 ]; do
    n_old=$n
    n=$(( m % n ))
    m=$n_old
  done
  if [ $m -lt $most_least ]; then
    pre_least=$most_least
    most_least=$m
  elif [ $m -lt $pre_least ]; then
    pre_least=$m
  fi
done

echo $pre_least