//パラメータ値の最大公約数を求める式
function gcd(a, b) {
    if (b === 0){
        return a
    }
    return gcd(b, a % b)
}
//主処理
function Main(input){
  //引数の受取。配列Aは数値化して格納
  input = input.split("\n");
  inputStr = input[0].split(" ");
  var N = Number.parseInt(inputStr[0]);
  inputStr = input[1].split(" ");
  var A = inputStr.map( inputStr => parseInt(inputStr));
  //最大の公約数を求める
  var max = 0;
  var tmp = 0;
  for(var i = 0 ; i < N ; i++){
    tmp = A[i];
    for(var j = 0 ; j < N ; j++){
      if( i !== j){
        //console.log(tmp,A[j],"gcdは",gcd(A[i],A[j]));
        tmp = gcd(A[i],A[j]);
        max = Math.max(max,tmp);
      }
    }
  }
  console.log(max);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
