var lines = [];
var result = 0;
var readline = require('readline');
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    N = Number(lines[0]);
    A = lines[1].split(" ").map(value => Number(value));

    A.sort((a, b) => a - b);
    var j = 0;
    for (var i = N - 1; 0 < i; i--) {
        var a = A[j]; var b = A[i];
        while (1) {
            var r = a % b;
            if (r === 0) { break }
            else {
                a = b; b = r;
            }
        }
        result = Math.max(result, b)
        if (A[i] % A[j] === 0) { j++ }
    }
    console.log(result);
});