function Main(input) {
  var args = input.split('\n');
  var n = args.shift();
  var a = args.shift().split(' ').map(m => parseInt(m)).sort((a, b) => b - a);
  console.log(`a: ${a}`);
  var maxum = a.shift();
  var a1 = a.map(m => euclid(maxum, m)).sort()[a.length === 1 ? 0 : 1];
  console.log(`a1: ${a1}`);
  maxum = a.shift();
  var a2 = 0;
  if (a.length > 0) {
    a2 = a.map(m => euclid(maxum, m)).sort()[0];
  }
  console.log(`a2: ${a2}`);
  console.log(a1 > a2 ? a1 : a2);
}

function euclid(u, v) {
  var r = 0;
  while (0 !== v) {
    r = u %v;
    u = v ;
    v = r;
  }
  return u;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));