console.log((args=>{
  const [[N],A] = args.trim().split('\n').map(r=>r.split(' ').map(v=>v|0));
  if ( N === 2 ) return `${Math.max(...A)}`;
  const D = [A[0],A[1]];
  for ( let i = 0; i < 2; i++ ) {
    let a = A[i];
    for ( let j = 2; j*j <= a; j++ ) {
      if ( a % j ) continue;
      D.push( j, a / j );
    }
  }
  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')));
