"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf8");

let lines = [];
var reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on("line", line => {
  lines.push(line);
});

reader.on("close", () => {
  const n = parseInt(lines.shift());
  const v = lines
    .shift()
    .split(/\s/)
    .map(i => parseInt(i));
  let ans = 0;

  for (let i = 1; i < n; i++) {
    let tmp = v.shift();
    const num = gcd(v);
    if (num > ans) ans = num;
    v.push(tmp);
  }
  console.log(ans);
});

function gcd(array) {
  var f = (a, b) => (b ? f(b, a % b) : a);
  var ans = array[0];
  for (var i = 1; i < array.length; i++) {
    ans = f(ans, array[i]);
  }
  return ans;
}
