"use strict";

var _constants = require("constants");

var hasN = true; // has N *only* line
var type = "b";
// a: 2D split
// b: space split
// c: line split
// z: other (only source)
function main(N, p, s) {
  // N, processed data, source
  var max = 0;
  for (var i = 0; i < p.length; i++) {
    if (p[i] > max) max = p[i];
  }
  var div = [];
  for (var _i = 0; _i < p.length; _i++) {
    div.push(divisor(p[_i]));
  }
  for (var _i2 = max; _i2 > 1; _i2--) {
    var count = 0;
    for (var j = 0; j < div.length; j++) {
      if (div[j].indexOf(_i2) >= 0) count++;
    }
    if (count >= div.length - 1) {
      console.log(_i2);
      break;
    }
  }
}
function common(a) {
  var line = a.split('\n').slice(0, a.split('\n').length - 1);
  if (hasN) var N = Number(line.shift());
  switch (type) {
    case "a":
      main(N, line.map(function (e) {
        return e.split(' ').map(function (ee) {
          return Number(ee);
        });
      }), a);
      break;
    case "b":
      main(N, line[0].split(' ').map(function (e) {
        return Number(e);
      }), a);
      break;
    case "c":
      main(N, line, a);
      break;
    case "z":
      main(N, null, a);
  }
}
function divisor(num) {
  var results = [];
  for (var i = 2; i <= num; i++) {
    if (num % i == 0) {
      results.push(i);
    }
  }
  return results;
}
common(require("fs").readFileSync("/dev/stdin", "utf8"));
