"use strict";

const gcdTwoNumbers = (x, y) => {
  x = Math.abs(x);
  y = Math.abs(y);
  while(y) {
    var t = y;
    y = x % y;
    x = t;
  }
  return x;
}

const getGcd = input => {
    let len, a, b;
    len = input.length;
	
	a = input[0];
	
	for (let i=1; i<len; i++ ) {
		b = input[i];
		a = gcdTwoNumbers(a, b);
	}
	
	return a;
}

const divisor = num => {
    var results = [];
    for(var i=num-1; i>0; i--) {
        if((num % i === 0) ) {
            results.push(i);
            break;
        }
    }
    
    return results.reverse()[1];
}
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = ~~arg[0];
    const a = arg[1].split(" ").map(n=>~~n);

    let min  = divisor(a[0]);
    let list = [];
    
    for(let i in a) {
        let div = divisor(a[i]);
        
        if(div < min) {
            list.push(i);
        }
    }
    
    let target = list.sort((a,b)=>a-b)[0];
    
    a.splice(target, 1);
    
    let answer = getGcd(a);
    
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));