function Main(x) {
    a = x[1].split(" ");
    console.log(a);
    var ans = 0, i, k;
    for (i = 0; i < a.length; i++) {
        var check = a.concat();
        check.splice(i,1);
        var gcm=check[0];
        for (k = 1; k < check.length; k++) {
            var r = check[k];
            while(gcm!=0&&r!=0){
                if (gcm>r)gcm=gcm%r;
                else r=r%gcm;
            }
            gcm+=r;  
        }
        if (ans<gcm) ans = gcm;
        // console.log(gcm);
        // console.log(check);
        
    }    
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").split("\n"));