console.log((args=>{
  const [[N],A] = args.trim().split('\n').map(r=>r.split(' ').map(v=>v|0));
  const gcd = (a,b) => {while(a)[a,b]=[b%a,a];return b;};
  if ( N === 2 ) return `${Math.max(...A)}`;
  const D = [gcd(A[0],A[A.length-1])];
  for( let i = 0; i < N - 1; i++ ) {
    D.push( gcd(A[i],A[i+1]) );
  }
  D.sort((a,b)=>b-a);
  DIVISOR: for( const d of D ) {
    let n = 0;
    for ( let i = 0; i < N; i++ ) {
      if ( A[i] % d && ++n > 1 ) continue DIVISOR;
    }
    return `${d}`;
  }
  return '1';
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
