

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

function Main(input) {
    var N = parseInt(input[0], 10);
    var A = input.slice(1).map(v => parseInt(v, 10));

    var max = 1;

    for (var i = 0; i < N; i++) {
        var dList = A.slice();
        dList.splice(i, 1);
        var r = gcd(dList);
        if (r > max) {
            max = r;
        }
    }

    console.log(max);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));